Re: parsing
From: David Trimboli (trimboli_at_cshl.edu)
Date: 07/29/04
- Previous message: Phil Robyn [MVP]: "Re: Scheduled Tasks"
- In reply to: Québec: "parsing"
- Next in thread: Matthias Tacke: "Re: parsing"
- Reply: Matthias Tacke: "Re: parsing"
- Reply: Al Dunbar [MS-MVP]: "Re: parsing"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Jul 2004 16:34:38 -0400
"Québec" <Once@WasEno.ugh> wrote in message
news:OATLPPYdEHA.2696@TK2MSFTNGP09.phx.gbl...
> Hi gurus,
>
> I have a line of code here that works so so but I would like it to write
the
> name of the file in wich it found the word.
> It search trough all files in a directory.
>
> type *.c| findstr assert >>Out.txt
I find that when using findstr directly (without piping another command into
it), and when the file parameter includes a wildcard, the command will tell
me which file the match comes from.
findstr assert *.c >>Out.txt
This will produce a text file with a series of lines of this format:
<filename>:<line containing match>
If you want to list the files that match without actually listing the
matching line itself, use this:
for /f "delims=:" %%i in ('findstr assert *.c') do (echo %%i >>Out.txt)
If you want to run this command directly on the command line and not in a
script, change %%i to %i in both instances.
David
Stardate 4577.2
- Previous message: Phil Robyn [MVP]: "Re: Scheduled Tasks"
- In reply to: Québec: "parsing"
- Next in thread: Matthias Tacke: "Re: parsing"
- Reply: Matthias Tacke: "Re: parsing"
- Reply: Al Dunbar [MS-MVP]: "Re: parsing"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|