Solved

Scanning for text in flat files

Posted on 2007-11-14
2
228 Views
Last Modified: 2010-04-23
I need to scan all the files in C:\MyFiles, look in each file for the text "XX4567" and then create a log file that displays which files included the text. These are for the most part small text/ASCII files. Thanks!
0
Comment
Question by:MuddyMojo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 20281548
With 'grep.exe' from http://unxutils.sourceforge.net/ you can just use

grep XX4567 c:\MyFiles\*.txt > filelist.txt

where 'filelist.txt' will then contain a list of all files that contain the search string.
0
 

Author Comment

by:MuddyMojo
ID: 20281773
For Windows I actually used: http://pages.interlog.com/~tcharron/grep.html

Worked great with no actual Windows install - Just copy file in! Would never have found it without you suggesting using grep in the first place so THANK YOU!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is about my first experience with programming Arduino.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question