On Mon, 30 Dec 2002, Mike Burnard wrote:
>
> The file I'm pulling data out of is formatted like this:
>
> 010 "red"
>
> 011 "diamond"
>
> 012 "lion"
>
> 010 "blue"
>
> 012 "blue whale"
>
> 011 "emerald"
>
> So, I've got this to get specific groups out at once:
>
> while (<OLDHL>) {
> if(/^010/) {
> -- part I need help with --
> }
> }
>
How about :
while (<OLDHL>)
{
chomp;
my ($num, $text) = split(/ +/, $_, 2);
$text =~ s/^"//;
$text =~ s/"$//;
if ($num eq '010')
{ --- Do this ---}
else
{ --- Do this ---}
}
Bye,
George P.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]