Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows VistaWindows XPWindows MeWindows 98Windows 95Virtual PCInternet ExplorerOutlook ExpressWindows MediaSecurity
Related Topics
MS Server ProductsMS OfficePC HardwareMore Topics ...

Windows Forum / Windows 98 / General Topics / May 2007

Tip: Looking for answers? Try searching our database.

How to search for files if there's a space in the filename?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Robert A. Macy - 27 May 2007 16:02 GMT
Stupid system can't search for a file name with blanks contained in
the filename.

If there are spaces in the file name and you put that section into the
search string, instead of searching for the string the stupid thing
looks for BOTH strings?!

Example:

filename:
1771 N 165th South City

Now want to find every file with the string "N 165" in it, so use
Windows Explorer search option and type the line
N 165

but instead of getting back the right files, I get EVERY file with the
letter N and ever file with the numbers 165

How do you search for a filename's string with a space in it?

Robert
Don Phillipson - 27 May 2007 18:24 GMT
> Stupid system can't search for a file name with blanks contained in
> the filename.
[quoted text clipped - 16 lines]
>
> How do you search for a filename's string with a space in it?

When you are sure of the filetype, the task
is easy.  If RTF, you search for *165th*.RTF
(i.e. with the longest unique part of the string
between  the wild card indicators *)

Signature

Don Phillipson
Carlsbad Springs
(Ottawa, Canada)

Hugh Candlin - 27 May 2007 19:17 GMT
> Stupid system can't search for a file name with blanks contained in
> the filename.

That is incorrect.

You're drawing an incorrect conclusion based on your lack of knowledge.

Replace each blank with a question mark(?) and try again.
Robert A. Macy - 29 May 2007 05:42 GMT
> > Stupid system can't search for a file name with blanks contained in
> > the filename.
[quoted text clipped - 4 lines]
>
> Replace each blank with a question mark(?) and try again.

I should have said, "Stupid system can't UNIQUELY search for a file
name with blanks contained in the filename."

And my conclusion for writing that statement was based upon my
observation, rather than a "lack of knowledge"

So back to my OBSERVATION:

Searching for a file name with a space in it worked better using the
wildcard character '?', yet still was not very good.
For example, a search for
n?65
returned 17 file names.
One had "...tn 265..." in it, and another had "...kinner 65..." in
it.  My lack of knowledge had no explanation for that!

However, instead of getting 773 files, I did get 17, which is more
manageable.

So, using a wildcard character helped keep the inclusion of unwanted
filenames to a manageable number.

Robert
Franc Zabkar - 28 May 2007 07:37 GMT
>Stupid system can't search for a file name with blanks contained in
>the filename.
[quoted text clipped - 18 lines]
>
>Robert

The following method is less convenient, but possibly more accurate
than using wildcards in place of spaces:

dir c:\ /b /s | find /i "n 165"

You can also write the search results to a file:

dir c:\ /b /s | find /i "n 165" > %temp%.\results.txt

- Franc Zabkar
Signature

Please remove one 'i' from my address when replying by email.

Robert A. Macy - 29 May 2007 06:00 GMT
> >Stupid system can't search for a file name with blanks contained in
> >the filename.
[quoted text clipped - 33 lines]
>
> - Show quoted text -

Franc,

Great suggestion!

I understand the dir statement
and understand the piping of the result to a file, but...
What is that vertical line between the dir and the find do?

The find /? says that it finds a string within what is typed at the
prompt before the find statement, but does not mention that a vertical
line is necessary.  Or, is that some kind of delimeter, or how the
results are piped to the next, or necessary when it's all one line?

Robert
Franc Zabkar - 29 May 2007 09:23 GMT
>>  dir c:\ /b /s | find /i "n 165"
>>
>> You can also write the search results to a file:
>>
>>  dir c:\ /b /s | find /i "n 165" > %temp%.\results.txt

>I understand the dir statement
>and understand the piping of the result to a file, but...
>What is that vertical line between the dir and the find do?

The vertical line is the "pipe" character. On my keyboard it is the
character above the backslash. It is sometimes drawn as a broken
vertical line.

>The find /? says that it finds a string within what is typed at the
>prompt before the find statement, but does not mention that a vertical
>line is necessary.  Or, is that some kind of delimeter, or how the
>results are piped to the next, or necessary when it's all one line?
>
>Robert

The "|" character pipes the output of one command into the next
*command*. Instead of the results of the "dir" command going to the
screen (ie standard out), they are presented as input to the "find"
command. The ">" symbol "redirects" the output of a command to a
*file* or *device*.

- Franc Zabkar
Signature

Please remove one 'i' from my address when replying by email.

Robert A. Macy - 29 May 2007 15:44 GMT
> >>  dir c:\ /b /s | find /i "n 165"
>
[quoted text clipped - 25 lines]
> --
> Please remove one 'i' from my address when replying by email.

Can really string quite a few together then?

Thanks for the suggestion.

It's  just that since " is not allowed as a character in a filename,
it seemed that it should be able to be used in the FIND tool to define
a string.  Oh, well.  Thanks again for a definitive way to find the
files.

Robert
... et al. - 29 May 2007 18:08 GMT
> It's  just that since " is not allowed as a character in a filename,
> it seemed that it should be able to be used in the FIND tool to define
> a string.  Oh, well.  Thanks again for a definitive way to find the
> files.

It can be used as you thought!

String containing space.
          N 165
( But it will search for all 'N'- and all '165'-containing filenames. )

Use '"' before and after to define the string.
         "N 165"
( But it will search for ONLY files named /N 165/ . )

So also use he '*' wildcard-character,
at the start and end of the defined string.
        "*N 165*"
( Then it will search for what you intended. (?) )

Signature

Nah-ah. I'm staying out of this. ... Now, here's my opinion.

    Please followup in the newsgroup.
    E-mail address is invalid due to spam-control.

Robert A. Macy - 29 May 2007 19:07 GMT
On May 29, 10:08 am, "... et al." <l...@sig.bcause.this.is.invalid>
wrote:

> > It's  just that since " is not allowed as a character in a filename,
> > it seemed that it should be able to be used in the FIND tool to define
[quoted text clipped - 21 lines]
>         Please followup in the newsgroup.
>         E-mail address is invalid due to spam-control.

The single search phrase
"N 165"
yields a ton of garbage, much of which I can't see why they were
listed, but...
"*N 165*"
gets EXACTLY what I want, as though I worked in DOS

Thank You!

Robert
Franc Zabkar - 29 May 2007 22:31 GMT
>> It's  just that since " is not allowed as a character in a filename,
>> it seemed that it should be able to be used in the FIND tool to define
[quoted text clipped - 15 lines]
>         "*N 165*"
>( Then it will search for what you intended. (?) )

Thanks for that.

With your technique in mind, the DOS version simplifies to ...

dir C:\"*N 165*" /b /s

- Franc Zabkar
Signature

Please remove one 'i' from my address when replying by email.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.