I got two text files with different formats,let says i already have known there are 4 non-empty lines in the file,shown below (1st is valid, 2nd is invalid).
AAA
BBB
CCC
END
(Blank line)
(Blank line)
AAA
BBB
(Blank line)
CCC
END
Any "for loop" implementations/ways to distinguish 1st file has 4 non-empty lines which can tell it's valid and 2nd file has a extra blank line in the middle which can tell it's invalid.
Because i got a for loop code which can count non-empty line number,applying that code in this 2 files,it gives me line number=4,which i don't want it cause 2nd file is invalid format. my for-loop code
set count=0
for /f %%a in (%text_file%) do set /a count+=1
echo %count%
Any suggestion to identify two files by using lines-counting method?
Or you can tell me how to count the number of lines from starting until the critical string "END",Thanks in advance^.^
this finds the linenumber of the (last) line, that is equal to
<StartOfLine>END<EndOfLine>