RE: skip/delete lines with dup keys

2005-07-27 Thread Jim
-- > > > > # file already sorted by $id > > my $cur_id = ''; > > while () { > > 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

Re: skip/delete lines with dup keys

2005-07-26 Thread Jeff 'japhy' Pinyan
On Jul 26, Jim said: Looking for ideas on the best way to skip/delete a line if the LOAN_NO repeat even if other fields ion in the record are not the same (need to remove lines with dup key fields). The code below seems to work, but there must be a better way. Your code works fine, assuming th

Re: skip/delete lines with dup keys

2005-07-26 Thread John W. Krahn
Jim wrote: > > Hi Hello, > I have csv file that has data something like this (Header in caps) > > LOAN_NO,SCORE,BAL > 77585,740,452125 > 77585,741,450256 > 85669,658,125869 > 85669,658,122586 > > Looking for ideas on the best way to skip/delete a line if the LOAN_NO > repeat even if other fi

skip/delete lines with dup keys

2005-07-26 Thread Jim
Hi I have csv file that has data something like this (Header in caps) LOAN_NO,SCORE,BAL 77585,740,452125 77585,741,450256 85669,658,125869 85669,658,122586 Looking for ideas on the best way to skip/delete a line if the LOAN_NO repeat even if other fields ion in the record are not the same (ne