THIS. If you have data, treat it as data. It's a bit more work to set up the first time, but after that it's so much easier - switching from csv to sqlite to mysql to Db2 to ... doesn't matter, it's so much easier once you see your data as actual data rather than a file format to fight with.

Life has taken me far afield from Perl (mostly C# and Javascript nowadays), but there's so much I've learned in perl that is relatively straight forward in other languages. Except this one: treating a csv file as a source for SQL without having to import it into an actual database system. There's lots I miss about perl, and many things in other languages that are the same (with a different, usually longer, syntax), but this one tops my list. You're using perl, take advantage of it.


In reply to Re^2: Help Sorting a CSV File by Tanktalus
in thread Help Sorting a CSV File by NorthernFox

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.