All very true. The files I use it on are quite small so the script works fine as is. I wont change it till i get a chance/need to test it agian, no point in putting broken code up! ;) But I will certainly update it.

Regarding the keys, the script makes the assumption, or requirment, that your key defines your unique values, so two rows are identical if there keys match, regardless of the other values. This fits my current needs because I'm comparing to reports to make sure they are outputing the same information, but they have different columns, a subset of which should be the unique key. At that point I care about the extra data in the differences because it helps determine what went wrong in the reports. None of this is by way of an excuse, just an explanation of the cause for the script and hopefully helps explain why it does what it does. It would be rather nice to end up with a generic solution that handles all these cases and perhaps I will work that direction. Thanks for the feed back.


___________
Eric Hodges $_='y==QAe=e?y==QG@>@?iy==QVq?f?=a@iG?=QQ=Q?9'; s/(.)/ord($1)-50/eigs;tr/6123457/- \/|\\\_\n/;print;

In reply to Re^2: Compare 2 csv files using a key set of colums by eric256
in thread Compare 2 csv files using a key set of colums by eric256

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.