RE: skip/delete lines with dup keys



------
> >
> > # file already sorted by $id
> > my $cur_id = '';
> > while (<F>) {
> > chomp;
> > ($id,$score,$bal) = split (/,/, $_);
> > next if $cur_id == $id;
> > print OUT "$id,$score,$bal\n";
> > $cur_id = $id;
> > }
>
> Don't fix it if it's not broken. :-)
>
>


Thanks John and Jeff. Just thought there may be a better way.

.



Relevant Pages

  • Re: Computer Switched Off During System Restore!
    ... In article, John ... > My grandfather has given me his computer to fix. ... Prev by Date: ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: OT: Top posting
    ... >>If anyone is a flame starter around here it's you. ... > Yo, John. ... Jeff R. ... Prev by Date: ...
    (rec.collecting.coins)
  • RE: error messages
    ... Were you able to fix? ... "JOhn" wrote: ... > message that "the spefified server was found, ... Prev by Date: ...
    (microsoft.public.outlook.installation)
  • Error Number: 0x80072F76
    ... but then I usually use Automatic Updates. ... know what's wrong or how to fix it? ... Jeff ... Prev by Date: ...
    (microsoft.public.windowsupdate)
  • Re: Late Night Qlink Party
    ... I suspected that it might be getting a little tight with it reformatted ... Thanks, I'll fix it tonight. ... Jeff ... Prev by Date: ...
    (comp.sys.cbm)