I need some Perl help from the masters. I haven't been able to figure this one out, or find anyone who can even begin to figure it out.

I have 2 data files I am trying to combine, and I have not been able to figure out a good way to do this that is not really sloppy. As an example, consider a Bug Tracking database.

One file contains the Bugs:

BUGS.csv BugID,Date,Subject,Priority 9551,03/01/2008,This is the subject,1 9552,03/03/2008,This is the subject,2 9553,03/06/2008,This is the subject,1 9554,03/07/2008,This is the subject,0 9555,03/08/2008,This is the subject,5
BUG_Comments.csv CommentId, BugId, Date, CommentBody 1023,9555,03/06/2008,This is the body 1024,9555,03/07/2008,This is the body 1025,9555,03/08/2008,This is the body

I need to have all the Comments for one bug, concatenated into one field.

WANTED: BUG_Comments_COMBINED.csv BugId, CommentBody 9555,"03/06/2008 This is the body 03/07/2008 This is the body 03/08/20 +08 This is the body"

The history is this: I am writing a script to manipulate data to migrate from our old bug tracker to our new one. The new one has only one field for ALL the comments. It also will only allow a one-time import, no updates. So I have to have ALL the comments from ONE bug, in a giant comments field.

I have started this off 100 times and it get's so stinkin' convoluted, I can't even read it anymore.

ANY ideas? At All? This MUST have come up somewhere before?

Thanks!

-Jamin


In reply to One to Many is Too Many? by Jamin

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.