So in the example, I need to keep only ID 13 with a date of 11052005 and ID 200 with the date 11012005. Thanks in advance....ID Date 13 10102005 13 09152005 13 11052005 200 11012005 200 11152004 Here's the code I wrote: foreach $data1(@data_241) { @compare1 = split($data1); foreach $data2(@data_241) { @compare2 = split($data2); if ($compare1[0] == $compare2[1]) { if ($compare1[1] > $compare2[2]) { print NEW "@compare1"; } } } }
In reply to Comparing rows keeping latest by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |