"4) sort the higest one "

Sort the highest one what?

Do you mean:

  1. sort by bitsin?
  2. sort by bitsout?
  3. extract the highest bitsin value?
  4. extract the highest bitsout value?
  5. something else entirely?

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:

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.
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.

Cheers,
Darren


In reply to Re: Sorting a CSV file by McDarren
in thread Sorting a CSV file by farhan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.