I got a question concerning grep. I would like to use it to pull out all
full lines of text, that starts with the word Status, from a list of
files. I am not really too experienced with using Metacharacters and
Metasymbols and do not know how to go about doing this with grep. Can
someone help
, February 13, 2003 10:23 AM
To: Perl-Win32 (E-mail)
Subject: question about grep
I got a question concerning grep. I would like to use it to pull out all
full lines of text, that starts with the word Status, from a list of
files. I am not really too experienced with using Metacharacters
: Thursday, February 13, 2003 10:23 AM
To: Perl-Win32 (E-mail)
Subject: question about grep
I got a question concerning grep. I would like to use it to pull out all
full lines of text, that starts with the word Status, from a list of
files. I am not really too experienced with using Metacharacters
]
To: 'Peter Guzis' [EMAIL PROTECTED], Perl-Win32 \(E-mail\)
[EMAIL PROTECTED]
Subject: RE: question about grep
Date: Thu, 13 Feb 2003 13:49:20 -0500
I tried what you did suggested and it only pulled out the word Status, here
is the code below;
#location contains the path for the report to be stored
to
get the desired results.
Thanks for your input
Eric
-Original Message-
From: Peter Guzis
To: Perl-Win32 (E-mail)
Sent: 2/13/03 1:32 PM
Subject: RE: question about grep
@matches = grep /^Status/, @data;
If this doesn't do it you might consider posting some sample data.
Peter Guzis
Web
Eric
I'm in a pretty-code-mode at the moment, my apologies for the overkill.
#location contains the path for the report to be stored
$report_location = $location;
$report_location =~ s/\//\\/;
To make this regex look a bit better you can use a different delimiter
rather than /. Also you
with while
(IFILE) {...}
HTH,
Joe Dial
-Original Message-
From: Hawley, Eric [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 1:49 PM
To: 'Peter Guzis'; Perl-Win32 (E-mail)
Subject: RE: question about grep
I tried what you did suggested and it only pulled out the word Status
Eric,
-Original Message-
From: Hawley, Eric [mailto:[EMAIL PROTECTED]]
actually I think I see what is wrong with the code. At
first I was reading the wrong variable which was producing
just the word Status and second after looking at the grep
function again it looks as though