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.



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.

  • Does it list which keywords were found? I don't need a list of the files. – Tod Birdsall 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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