my %sequence; while (<>) { my @line = split; my $sequence = ++$sequence{$line[0]}; print "@line $sequence\n"; }
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to Re: Generating sequence nos. for data
by merlyn
in thread Generating sequence nos. for data
by icg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |