top of page

Add File Names to Text Files


If you're combining a large set of text files together (perhaps with method described in the Litigation Support Tip of the Night for January 15, 2016) it may be helpful to add in the name of the files to the actual text, in order to keep track of where the content text came from.

See this example where we start with text files in which the file names are those of famous writers. See this example, where the content is shown in the preview pane on the right.

Now press CTRL + SHIFT, plus right click in the folder containing the text files you want to analyze, and select 'Open command window here'. At the command prompt enter:

findstr "^" "c:\add file name\*.txt" >output.txt

Then check the source folder with text files you want to analyze and you'll see that a new file has been generated with the paths and file names of the source text files, and their content as well.

Special thanks to those who posted on Stack Overflow here.

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