Re: parsing

From: Al Dunbar [MS-MVP] (alan-no-drub-spam_at_hotmail.com)
Date: 07/30/04


Date: Thu, 29 Jul 2004 19:21:59 -0600


"David Trimboli" <trimboli@cshl.edu> wrote in message
news:ejPR5tadEHA.2664@TK2MSFTNGP09.phx.gbl...
> "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>

Even good old find works well in this manner (for simple searches, at
least):

    find /i "assert" *.c >>Out.txt

Try both, and pick the one whose output format you find most convenient.

/Al



Relevant Pages

  • Summary: Boot Error
    ... All Gurus: ... the correct response which is here: ... Probably the command '/usr/dt/bin/dtprintinfo -populate' is not working as ... and /etc/rc3.d to see if I could locate the "env" string to no avail. ...
    (SunManagers)
  • [HPADM] Changing Kernel Parameters in the command line.
    ... HP Gurus: ... I need to change a few kernel parameters like ... command lines. ... development servers. ...
    (HP-UX-Admin)
  • Run a Java packaged inside a Jar
    ... I am new to Java and I am working on web services directly. ... quick question to you gurus. ... I want to run the command ... Prev by Date: ...
    (comp.lang.java.programmer)
  • Re: find highlighted text (word 2007)
    ... You can certainly find highlighted text through the normal Find command, but I don't see a way to find only Yellow - though some of the Gurus may know a way to do it with code. ... Terry Farrell - MSWord MVP ...
    (microsoft.public.word.newusers)
  • Re: MiKTeX/Yap misbehavior: MiKTeX outputs 128 pages, Yap sees 105
    ... THE OUTPUT FORMAT CAN CHANGE BY CHANGING THE PREAMBLE CODE, ... CHANGING THE COMMAND LINE!! ... Note that a global document option is passed on to packages. ...
    (comp.text.tex)