Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a list of 1285 keywords (database object names) that I have compiled into a TXT file; one keyword per line. I would like to search a directory of files (most have a .aspx or .cs extension) using this list of keywords.

My main goal is find out which of the 1285 database objects are being referenced in these files.

Can anyone recommend a tool that could accomplish this? Otherwise, I will just create my own.

Thanks.

share|improve this question

1 Answer 1

If you are Unix/Linux savvy, you can download GNU utilities for windows (http://unxutils.sourceforge.net/) and use grep.

The "grep -f" flag will take a filename as input, your list of database objects, and search a directory for matches.

For example:

grep -f myDBObjects.txt -r *.aspx

The -f specifies the file name with the patterns to match, one per line, and the -r indicates recursive, to search through all subdirectories from the current directory.

If you install the GNU utilities, don't forget to add the BIN directory to your path in windows.

share|improve this answer
    
Does it list which keywords were found? I don't need a list of the files. –  Tod1d Jun 1 '10 at 22:10
    
yes, grep will provide you with the name of the file followed by the matching line. Example: >grep blah *.java Test.java: //has blah in this sentance Test2.java: someMethod(String blah) –  RussellW Jun 4 '10 at 21:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.