A quick search gives me tawbaware wc, but it does not accept stdout as input stream, meaning I can not use pipe within a DOS session.
Note:
I can not install cygwin or use powershell (which would have allowed a '|foreach-object {(get-content $_).count}
')
unxutils and and gnuwin32 Packages might have this feature...
The Linux/Unix "line count" command, wc -l , has a Windows equivalent find /c /v "" .
The wc (word count) command in Unix/Linux operating systems is used to find out number of newline count, word count, byte and characters count in a files specified by the file arguments. The syntax of wc command as shown below.
Display number of word count only of a file: We all know that this can be done with wc command having -w option, wc -w file_name, but this command shows two-columnar output one is count of words and other is file name. So to display 1st column only, pipe(|) output of wc -w command to cut command with -c option.
Use the wc command to count the number of lines, words, and bytes in the files specified by the File parameter. If a file is not specified for the File parameter, standard input is used.
Even easier, find /c
. ex:
netstat -an | find /c "ESTABLISHED"
find /c
: Displays only the count of lines containing the string.
You can use the original "wc", built for windows: it is part of the coreutils package. Get the most recent coreutils exe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With