top of page

the many functions of findstr


The June 6, 2016 tip of the night demonstrated how you can use the findstr Windows command to merge multiple text files. findstr can also be used to search through files - and there are a lot of options on how to run searches.

If you enter:

findstr /?

. . . at a command prompt you will see generated a description of how to structure a findstr search and a number of qualifiers that define the search.

I'm going to try to run different kinds of findstr searches on a folder containing some text files.

We begin with a text file, whitewhale.txt, at the root of a folder with the path C:\foofolder2

this folder has a subfolder with two files . . .

. . . one file with this content:

. . . and a second file with this content

when we enter the command:

findstr "moby" *.txt >C:\Process\results1.txt

. . . a text file is generated showing the line in the text file at the root of the home folder which includes the referenced string.

Including the reference /S in the command makes it search through subfolders in the home folder.

Using the reference in the command /R allows you to enter a regular expression search. Here we use the RegEx [0-9][0-9][0-9][0-9] . . . to search for lines with four digit numbers .

If we enter in the reference /V the findstr command will return lines that don't contain the referenced string.


Sean O'Shea has more than 20 years of experience in the litigation support field with major law firms in New York and San Francisco.   He is an ACEDS Certified eDiscovery Specialist and a Relativity Certified Administrator.

​

The views expressed in this blog are those of the owner and do not reflect the views or opinions of the owner’s employer.

​

If you have a question or comment about this blog, please make a submission using the form to the right. 

Your details were sent successfully!

© 2015 by Sean O'Shea . Proudly created with Wix.com

bottom of page