Need to count number of lines from the first line of a file up to a unique character (batch) -


i'm new in batch. think question simple you. need batch script count number of lines first line of file unique character "a015" contained file (this number should take account blank lines). thank you.

try this:

for /f "delims=:" %%i in ('findstr /n "a015" "file.txt"') if not defined linenumber set "linenumber=%%i" if defined linenumber (echo "a015" found @ line %linenumber%) else echo "a015" not found 

if there more 1 "a015" in text file, show first line number.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -