ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   dos (https://www.excelbanter.com/excel-programming/340575-dos.html)

Denny

dos
 
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?

Tom Ogilvy

dos
 
No.

--
Regards,
Tom Ogilvy

"denny" wrote in message
...
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?




Denny

dos
 
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


"denny" wrote:



Dave Peterson

dos
 
find has another switch /I means ignore case.

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

denny wrote:

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

"denny" wrote:


--

Dave Peterson

Denny

dos
 

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


Dave Peterson

dos
 
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.



denny wrote:

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


--

Dave Peterson


All times are GMT +1. The time now is 12:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com