On Mon, Mar 3, 2008 at 5:32 PM, David Newman <dnewman@xxxxxxxxxxxxxxx> wrote:
> Greetings. I'm looking to compare two contact lists in csv format, and
> then print out "here are the records in in Llist only, in Rlist only,
> and what's in common."
> I should compare only 3 of the 82 fields in each list. There are
> differences in some of the other fields that I should ignore.
> If I read in each csv file as an array, List::Compare does a nice job of
> comparing all 82 fields as a single array element. But I should only
> look at 3 fields, not all 82. (snippet A below)
> I can also use List::Compare plus a split function to strip out just the
> 3 fields I'm comparing. However, the resuling arrays then only have
> three fields in each array element. (snippet B below)
> How to compare only selected fields in each list, but then present all
> fields for any matches?
You've gotten some good advice, here, but I have to ask, why reinvent
the wheel? Take a look at DBD::CSV, or at least consider using
Text::CSV to parse the lines for you, instead of relying on split. CSV
can get pretty nasty, especially for name and address data (think Doe,
Jr., John), and those modules are out there.
This email and attachment(s): [ ] blogable; [ x ] ask first; [ ]
private and confidential
daggerquill [at] gmail [dot] com
http://www.tuaw.com http://www.downloadsquad.com http://www.engatiki.org
values of β will give rise to dom!