dos

G

Guest

When I type out FIND in DOS....it finds the word, but if I put it in a batch
file, it doesn't come up with an answer. Is there any difference between
regular DOS and the window of DOS in that regard?
 
G

Guest

I tried again and it worked. Patience must be the key. This was what
worked.
My file was called findtest so when it finds a word in a dos file you type
findtest Heart, for an example. The way it is now, it is case sensitive.

rem prompt $
rem @ echo off
find "%1" /c c:\mydocu~1\findtest.txt > c:\mydocu~1\found1.txt
find "%1" c:\mydocu~1\findtest.txt > c:\mydocu~1\found2.txt
copy c:\mydocu~1\found1.txt+c:\mydocu~1\found2.txt c:\mydocu~1\found.txt
type c:\mydocu~1\found.txt
rem cls


:
 
D

Dave Peterson

find has another switch /I means ignore case.

You can type:
find /h
at the command prompt and see more info.
 
G

Guest

/I means ignore case.--That one worked for me, but find /h and findstr /?
didn't bring up anything
 
D

Dave Peterson

Doh! I think /h worked with old versions of DOS (3.x??).

But
find /?
did work from a cmd prompt in winXP home:

C:\>find /?
Searches for a text string in a file or files.

FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[ ...]]

/V Displays all lines NOT containing the specified string.
/C Displays only the count of lines containing the string.
/N Displays line numbers with the displayed lines.
/I Ignores the case of characters when searching for the string.
/OFF[LINE] Do not skip files with offline attribute set.
"string" Specifies the text string to find.
[drive:][path]filename
Specifies a file or files to search.

If a path is not specified, FIND searches the text typed at the prompt
or piped from another command.
 

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