1

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.

1 Answer 1

2

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.

2
  • Does it list which keywords were found? I don't need a list of the files. Jun 1, 2010 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, 2010 at 21:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .