Tech Writing Tips

Wednesday, December 13, 2006

External Searching

In the last column, I discussed internal searches, that is, searching within a document for specific instances of text. Of sometimes greater importance are external searches, namely, searching through multiple files to find out which ones contain the desired text. External searching usually starts right after you say something like, "I know it's in one of these files, but I can't remember which one." Naturally, once you pinpoint which files have what you're looking for, then you can do internal searches on each one to zero in on the specific instance of the text.

On a Windows system, you have the option of using its built-in Search function, which you can access from any Windows Explorer window. If you know which directory (or folder) you want to search – including the entire drive – just right-click that item and hit E for Search (thanks for the easy mnemonic, Microsoft!). A Search Results box will pop up, and you can enter your search criteria, including filename wild cards (like *.doc if you know it's in a Word document), the specific text you're looking for, when it was modified, what size files to search, and so forth. Click Search, and the search starts, recursively looking in every sub-directory or sub-folder of your starting point. A list of files that match your criteria will appear, and you can then proceed from there.

This is a pretty fast and easy search function, and really, its only drawback is that it doesn't work very well. It typically won't find text in FrameMaker files or PDFs, for example. Sometimes it does, and sometimes it doesn't. While such flexibility is admirable in people, it isn't in search utilities.

For this reason, I like to use a quick and dirty search tool that runs on – brace yourself – DOS. The utility is TS.EXE, part of the Norton Utilities collection of tools. This sucker is ancient, but it gets the job done thoroughly and even with a few bells and whistles. You run this from the DOS prompt (aka Command Prompt in the Windows Accessories folder), meaning you somehow need to navigate using the CD command to the folder you want to search in.

Once there, you can run TS (make sure it's in a directory on the default path, like the WINDOWS directory) with the "/?" option to get all its parameters. Here's a typical command I use:
TS *.fm "program manager" /s /a /log >> \output.doc
This command includes the wildcards for FrameMaker files (*.fm), the text to search for in quotes, a flag to search all subdirectories of the current directory (/s), another flag to automate the process (/a), and yet another flag to give output in a log type format (/log). The final mumbo jumbo (>> \output.doc) sends the output of this search to a file called output.doc in the root directory, which I can peruse at my leisure when the search is done.

TS will find all occurrences of the text string. I recommend it highly. The only problem is that you might not have a copy of this DOS utility lying around. Luckily, you can download it from a truly wonderful site (http://vetusware.com/download/Norton%20Utilities%208.0/?id=3515), which hosts abandoned software of all kinds, just so jackals like us can come along and use it.

How did I find this site? I searched for it, of course.

0 Comments:

Post a Comment

<< Home