We don't bite newbies here... much | |
PerlMonks |
Sorting a CSV fileby farhan (Novice) |
on Jul 17, 2006 at 02:00 UTC ( [id://561634]=perlquestion: print w/replies, xml ) | Need Help?? |
farhan has asked for the wisdom of the Perl Monks concerning the following question:
I have comma separated CSV file. And there are 5 columns date,delta time, bits, bitsin, bitsout. Task is 1) sort the file by date 2) ignore the bits 3) compare the bitsin and bitsout and keep the highest one 4) sort the higest one 5) print all above four steps comma separated I have done first 3 steps and i dont know how i can perform step 4 any body can help me Raw Data File Contents 12/6/2006 00:02:23,301,1151.78735352,677.26245117,474.52490234 12/6/2006 00:07:22,299,1108.97656250,641.49835205,467.47827148 12/6/2006 00:12:22,300,1020.15997314,590.40002441,429.76000977 12/6/2006 00:17:23,301,981.26245117,562.01995850,419.24252319 OutPut File 1/6/2006 00:03:46 300,641.06665039,477.60000610,641.06665039 1/6/2006 00:08:46 300,563.78668213,425.60000610,563.78668213 1/6/2006 00:13:47 301,505.99334717,430.72424316,505.99334717 Wanting Output 1/6/2006 00:03:46 300,641.06665039,477.60000610,641.06665039 ,505.99334717 1/6/2006 00:08:46 300,563.78668213,425.60000610,563.78668213 ,563.78668213 1/6/2006 00:13:47 301,505.99334717,430.72424316,505.99334717 ,641.06665039
2006-07-17 Retitled by Corion, as per Monastery guidelines
Back to
Seekers of Perl Wisdom
|
|