in reply to grep fields
Details:
I have a file that has 21 fields and 100's of records. I've sucked that file into an array (@recs), and I want any records(elements) from the @recs array in a new array(@goodrecs) that have a given email address in the 4th field. Each record(element) in the array @recs is ":" delimited. You could think of it like reading a passwd file into an array:
open(FH, "<passwd") or die $; my @recs = <FH>; etc....
so what I'd like to do is something like:
my @goodrecs = grep(/^.*?:{3}foo@foobar.com/, @recs);
This does not work. But That's the idea.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: grep fields
by tbone (Beadle) on Sep 25, 2003 at 20:10 UTC | |
|
Re: Re: grep fields
by Not_a_Number (Prior) on Sep 25, 2003 at 20:53 UTC | |
|
Re: Re: grep fields
by graff (Chancellor) on Sep 26, 2003 at 03:42 UTC |