Rob Dixon wrote:
>
> use strict;
> use warnings;
>
> open INFILE, 'myfile.txt' or die $!;
>
> while (<INFILE>) {
> chomp;
> my @fields = split /\|/;
> my @output = grep /^(E|FE|NQ|IQ)/, @fields;
> print join('|', @output), "\n";
> }
>
> **OUTPUT
>
> Exxxxx|FExxxxx|NQxxxxxx|IQxxxxxxxx
> Exxxxx|FExxxxxx|NQxxxxxx|IQxxxxxxx
> Exxxxx|FExxxxxxx|NQxxxxxx|IQxxxxxxx
> Exxxxx|FExxxxxx|NQxxxxxx|IQxxxxxxx
And, of course, that regex should be
/^(E|FE|NQ|IQ|OU)/ # With or without the \d
to do what was asked.
My apologies.
/R
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]