in reply to Sorting a CSV file
"4) sort the higest one "
Sort the highest one what?
Do you mean:
You need to clarify.
By the way, the "sorting by date" that you've implemented does not work. If you enable warnings, you will see the following output:
You get that because you are tring to do a numeric sort on "stringified" data. To properly sort by date, you'll need to first convert the strings into something that sort can make sense of. For example, a unix timestamp. Something like Date::Manip or Date::Calc will be useful for that.Argument "12/6/2006 00:07:22" isn't numeric in numeric comparison (<=> +) at foo.pl line 15, <DATA> line 4. Argument "12/6/2006 00:02:23" isn't numeric in numeric comparison (<=> +) at foo.pl line 15, <DATA> line 4. Argument "12/6/2006 00:17:23" isn't numeric in numeric comparison (<=> +) at foo.pl line 15, <DATA> line 4. Argument "12/6/2006 00:12:22" isn't numeric in numeric comparison (<=> +) at foo.pl line 15, <DATA> line 4.
Cheers,
Darren
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sorting a CSV file
by farhan (Novice) on Jul 17, 2006 at 03:44 UTC | |
by McDarren (Abbot) on Jul 17, 2006 at 05:03 UTC | |
|
Re^2: Sorting a CSV file
by farhan (Novice) on Jul 17, 2006 at 03:40 UTC | |
by McDarren (Abbot) on Jul 17, 2006 at 04:37 UTC |