Windows desktop search fails to search inside .SQL files

8,822

Solution 1

This might not be relevant, but for things like this I really like using the command-line. It's really quick and allows you to specify regular expressions and other features like matching the beginning (or end) of a line.

  • Hold down shift, and right-click the directory you want to search
  • Choose 'Open Command Window Here'
  • Type findstr "order by" *.sql
  • If you want to search sub-directories also, just use findstr /S "order by" *.sql

This will return all files named *.sql with the string "order by" in them. There are lots of command line switches to include things like line numbers, just type findstr /?

Solution 2

This would obviously be suboptimal, but have you tried copying the .SQL files to .TXT files?

I don't mean simply rename, since you are presumably using the SQL files as SQL files somewhere. But if you have the space, make copies and rename those to .SQL.TXT or so. If your SQL files change frequently, schedule a task to re-create the copies.

This would be worthwhile as an experiment -- if Windows Desktop Search can successfully index a .SQL.TXT file, there's something about the .SQL extension that it's failing on. If it can't, something about the file's format is confusing it.

Solution 3

Just use Qytec's free Portable File Seeker instead of Windows Desktop Search. It can successfully search within files with provided extensions. You don't need to install it since it's portable. I tried it on my .SQL files and it works without any problems. Here is a screeny from my PC:

alt text

Share:
8,822

Related videos on Youtube

Dan Blanchard
Author by

Dan Blanchard

Updated on September 17, 2022

Comments

  • Dan Blanchard
    Dan Blanchard over 1 year

    I've set the index options for the .SQL extension to use "Plain Text filter" with "Index Properties and File Contents" selected, and ensure that the directories containing the SQL files are in the "Included Locations".

    Unfortunately, Windows desktop search still fails to find anything in the .SQL files. Other file types such as .cs, .docx etc are searched successfully.

    I'm running Windows XP SP2 - and it's a work machine where I can't easily install alternative search engines so I'm stuck with Windows Desktop search for indexed searching.

    Obviously I can search the .SQL files using other (non-indexed) techniques, but I prefer the speed of Desktop Search - if I could get it to work.

    Update: Having copied a couple of .SQL files to .SQL.TXT files in the same directory as suggested by ~quack, added .SQL.TXT as a file extension to the indexing options (using the plain text filter, with "Index Properties and File Contents" selected) and re-indexing, Desktop Search still fails to find strings in either the .SQL or .SQL.TXT files.

    Additional info: after re-indexing, I checked the file types in the Desktop Search advanced options and noted that the .SQL.TXT file extension no longer appears in the list of file types.

  • Dan Blanchard
    Dan Blanchard over 14 years
    Sorry - I should have been clearer regarding installation of other search engines: as it's a work machine I can't USE anything other than the tools already provided on the machine.
  • Greg Jennings
    Greg Jennings over 14 years
    So good luck with WDS.
  • Dan Blanchard
    Dan Blanchard over 14 years
    Interesting: having copied a couple of .SQL files into .SQL.TXT file AND rebuilt the indices, Desktop Search STILL fails to find strings within these files. As a desperate measure, I've added .SQL.TXT as a file extension to the indexing options - now I have to wait a few more hours to re-index...
  • zagrimsan
    zagrimsan almost 8 years
    This is exactly how I've solved this inadequacy of the GUI search, even though most of the time I'm using findstr /m since the file content doesn't usually format that nice on the cmd window.
  • Admin
    Admin almost 2 years
    This is a nice solution, but works slowly on large directories with lots of files. Any advice for speeding it up?