In order to fix code many a times one needs to search for terms, function names, defect/case ID's etc in SQR/SQC/INC (henceforth referred to as SQR files) files.

TextPad allows one to search thorough folders containing files having certain terms (e.g a defect ID or a case number) which is suspected to be related to a bug. However this process is often very slow as TextPad needs to open each and every file one by one and parse through it.

If there was a way by which we could index all terms in SQR files and store them upfront the amount of time required to search problem areas in SQR's and fix them could be drastically reduced.

Fortunately there are two free tools one could use to index these files. The first is an open source tool called Lucene and the second is Microsoft's Indexing Service that comes by default with the Windows XP operating system.

Lucene though very powerful needs knowledge of Java to build an application which would fit our needs.

Microsoft Indexing Server on the other hand is simpler to configure. The service can be accessed through Control Panel > Administrative Tools > Computer Maintenance. All one needs to do is create a new Catalog and add the directories which have the SQR files. The indexing service keeps a track of any changes made to the files and updates the indexes automatically. However, one needs an IFilter implementation to read SQR files even though SQR files are as good as text files. There is one workaround though. Change the file extension from .SQR to .SQR.TXT.

If you want to search on the index, all one needs to do is query the catalog and presto you can search through all the code that resides in your SQR files. Only those files which have the term would show up in the search results.

To take it one step further one could write a program to use this index and highlight terms in the file.