Reputation: 29
I have a txt file that has some lines that are empty How can i get the numbers of lines that are empty in a .txt file?
I would like to do this using either .bat or cmd line
Upvotes: 0
Views: 1796
Reputation: 41234
This will count blank lines containing no text, and no spaces etc.
findstr /n "^$" "file.txt" |find /c /v ""
Upvotes: 0
Reputation: 56180
findstr /n /v "." file.txt
/n
gives the lines with leading linenumbers (or just linenumbers for empty lines)
/v
only list lines that DOESN'T contain ...
"."
... any char in
file.txt
Upvotes: 1