I have a huge files with e-mail addresses and I would like to count how many of them are in this file. How can I do that using Windows\' command line ?
I have tried
Using what you have, you could pipe the results through a find
. I've seen something like this used from time to time.
findstr /c:"@" mail.txt | find /c /v "GarbageStringDefNotInYourResults"
So you are counting the lines resulting from your findstr
command that do not have the garbage string in it. Kind of a hack, but it could work for you. Alternatively, just use the find /c
on the string you do care about being there. Lastly, you mentioned one address per line, so in this case the above works, but multiple addresses per line and this breaks.