Quantcast
Channel: Greg – code.commongroove.com
Viewing all articles
Browse latest Browse all 30

Using findstr.exe to Parse Text Files – Simple “grep” for Windows

$
0
0

The DOS command findstr.exe can help you …find strings… in text files.

In conjunction with a for loop and tokenization, you can perform actions on the match results.

For example, the following command finds the string “Delivery Status Notification” in all “.eml” files in the current directory and move them to another directory:

for /f "tokens=*" %a in ('findstr /M /L /C:"Delivery Status Notification" *.eml') do move %a C:\temp\moved_emails

Hope this helps!


Viewing all articles
Browse latest Browse all 30

Trending Articles