find file containing text inside the file

G

Guest

Please tell me how can I find a file, such as a text file, that contains a
specific string within the file. For example I create (AutoCAD) Autolisp
programs with an extention of *.lsp which is just a basic text file that
contains my code. In XP (I got rid of the dog and set it up to the advanced
appearance) I just clicked on the search button and entered *.lsp (in the
first box that says "All or part of the file name:") and in the box below
that says "A word or phrase in the file:" I could enter a particular word
that I was sure was in one of my files such as: slope or distance or drain.
In XP this worked very well and I still do it dozens a time a day. Now as I
transition to Vista I need to have this ability, it's a must have. Please let
me know how i can do this. Thanks
Richard
 
D

Dave Johnson [MSFT]

Richard,

The reason that you can't currently do full text searches is becuase the
index is conservative about what file types it crawls to improve your
computer's performance. What you need to do is to add the .lsp file
extension to the index so it looks for these files.

To do that, open Indexing Options in the Control Panel and click Advanced,
then click the File Types tab. Add the .lsp file type and be sure to click
the option to "index properties and file contents."

After the index has had a chance to update, you can type a word or phrase in
the search box to find the file with that text in the contents.

Depending upon where you store these files, you might also need to add the
location to the index. If you keep these files somewhere in your user folder
(Documents, Pictures, Music, etc) you're fine. Otherwise, in the Indexing
Options, click Modify and add the folder to the list of Indexed Locations.

Hope this helps.
 
G

Guest

Dave
Thanks for the reply. I already had the lsp extension indexed but have
redone the indexing and letting it build index right now. But I am still not
clear on what to type in the search pane to find a .lsp file that contains a
word in the file. Do I need to follow some sort of format or syntax for the
search?
please tell me exactly what I need to type to find the following:

a .lsp file that contains the word "defun" (no quotes in the file...just
shown here for clarity) in the files contents.

By the way I can't really believe that this type of search option (the
ability to search for a word or phrase in the file) has been removed from
vista interface. Is there some reason for this?
Thanks
Richard
 
D

Dave Johnson [MSFT]

Richard, to find all the files with the string "defun" in the body of the
document, just type "defun" in the search box. That's really all you need to
do.

The ability to do a full text search hasn't been removed from Windows, it's
been made easier to do so you don't have to dig deep in advanced search
options to turn it on. Believe it or not, many casual users didn't even know
it was possible to do a full text search in Windows XP. Now you just type a
word or phrase and search finds it automatically, without the need to find
additional settings.

If you definitely want to only include a specific file type, then you could
type this in the search box instead:

defun type:lsp

That filters the results to only show files with the indicated file type.

You can learn more about how search works by reading this help topic:

http://windowshelp.microsoft.com/Windows/en-US/Help/73106209-6df0-432a-8cb7-df5d8ce02ec61033.mspx
 
D

Dave Wood [MS]

You just type into the search box. By default file contents, filenames,
e-mail bodies etc. are all searched automatically.

So you could type: defun *.lsp

Or something like: defun ext:lsp
 
G

Guest

Dave
Thanks for the reply. It finally makes sense and I can now find what I'm
looking for because of your reply as well as Dave Woods comments (in the next
reply)

this makes it clear
defun type:lsp


This is from the help file you referenced (which i had read previous to
posting my question)
A more specific indication of the file's content. The last three letters of the file name, called the file >name extension, identify the file type. Common types include DOC (Microsoft Word document), XLS
(Microsoft Excel spreadsheet), JPG (JPEG image), and MP3 (a standard digital audio format).

However in no part of the help file does it mention the use of the word
"ext" to deliniate extention as shown in the next reply to my post by Dave
Wood where he spells it out as shown below:
So you could type: defun *.lsp
Or something like: defun ext:lsp
The above makes it really clear.

and you write in your reply:
If you definitely want to only include a specific file type, then you could
type this in the search box instead:
defun type:lsp

again this does not appear in the referenced help article. There is mention
of file types but if you made clear examples of uses of the word "type" as
well as "ext" and how to use it when searching more obvious in your (MS) help
article I think it would help more people to understand how to search with
greater effectiveness. In other words I searched the web and help files for
this information and finally had to resort to this forum in order to find
this critical information. Please consider updating the help to illustrate
this feature.
Thanks again to both of you for providing me with help
Richard
 
G

Guest

Dave I replied with my comments to both of you in the post from Dave Johnsons
reply to me.
Thanks for spelling it out and please consider my reply to Dave Johnson
about updating your help files to clarify the use of the words "type" and
"ext"

thanks
Richard
 
R

Retroman

Imagine the folowing situation: I downloaded .zip-archive with thouzands
of .php-files. I unpacked the file to the folder at my Desktop (which is
indexed by default). I want to find all files containing string «Test».
So, I added «Plain text filter» to the .php files extension in the
indexing settings. Should I wait hours until the indexing will be done?
Or I can just search (more slowly)? I tryed and did not get any results!
So, I will wait. It's very annoying!

Another case: I want to find files containing Russian word
«Привет». The problem is that that
word can be encoded by different bytes depending on codepage (most
popular are cp1251, UTF-8, KOI8-R). I tested text search and found that
if BOM present at the start of the file, file considered UTF-8,
otherwise file considered cp1251. But how about UTF-8 files which do not
have BOM mark at the beginning? When I program PHP I always remove BOM,
because othervise these BOMs are sended to the user-agent by server.
Notepad application still detects UTF-8 in such files, but Search is not
(see attached files). Also, how about KOI8? I didn't find any way to
specify encoding in search options.

Third case: how about different word forms in Russian? «One day» =
«Один день», «Three
days» = «Три дня», «Five days» =
«Пять дней», «All these
days» = «Все эти
дни»,... How I will find
«день» («day») with all possible forms?

It's a pity that Windows text search is completely useless. :(
So, you find a few unusual situations that don't work as you would like
and you then conclude that Search is useless? That is laughable. I've
been using Windows Search on Vista for over two years, and overall it
works extremely well, once I learned how to use it.

Incidentally, the Desktop folder is *not* indexed by default. Try moving
your files to your Documents folder.

This forum is actually on Usenet, not on the "parasitic" Web forum that
you posted from. As a result, the HTML character entity references in
your examples are not decoded for most readers. It's unlikely that
English-speaking users are going to be able to help you anyway, since your
problems involve searching for Russian words. I suggest that you look for
a support forum for Russian-speaking users of Vista.

Doug M. in NJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top