Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to pass/pipe a file list to FINDSTR ?

1,029 views
Skip to first unread message

Sebastian Kaist

unread,
Jul 1, 2009, 4:11:25 PM7/1/09
to
The following pipe command cannot be done:

dir /Tw /Od /A-d /B *.log^|findstr /n /I DATA:

MSDOS command prompt tells me:

Invalid switch - "I".

How else can I pass a list of files to FINDSTR?

Sebastian

Pegasus

unread,
Jul 1, 2009, 5:09:16 PM7/1/09
to

You could do it like this:
for %a in (*.log) do findstr /n /i "Data:" "%a"

foxidrive

unread,
Jul 1, 2009, 8:07:29 PM7/1/09
to
On Wed, 1 Jul 2009 14:09:16 -0700 (PDT), Pegasus <Pegas...@yahoo.com>
wrote:

You can use this switch, but I think your issue is that the ^ carot is not
used in a command line, unless it is part of a for-in-do command string

/F:file Reads file list from the specified file(/ stands for console).

bud

unread,
Jul 2, 2009, 12:59:43 AM7/2/09
to

Group: comp.os.msdos.misc Date: Wed, Jul 1, 2009, 8:11pm (CDT+5) From:
wi...@lycos.de (Sebastian Kaist)

script:

>The following pipe command cannot be done:
>
>dir /Tw /Od /A-d /B *.log^|findstr /n /I DATA:
>
>MSDOS command prompt tells me:
>
>Invalid switch - "I".

IIRC, there must be a space before and after the pipe symbol. (Double
vertical dash: '|' )

The clue may be that DOS calls it a switch. Switches apply only to a
command. Pipe is a command unto itself.

salaam,
dowcom

To e-mail me, add the character zero to "dowcom". i.e.:
dowcom(zero)(at)webtv(dot)net.

The fact that 'conventional wisdom' is indeed 'conventional',
does not, in any way, imply that it is wise.

0 new messages