Doesn't seem that hard. The code below outputs the BUG_Comments_COMBINED.csv file, though it doesn't worry at all about the order in which it outputs lines. If that matters to you, it can be adjusted.
#!/usr/bin/perl -l
use strict;
use warnings;
my %comment; #comment for each bug id
<DATA>; #skip header line
while(<DATA>){
chomp;
#the 4 in the split below ignores all comma in the comment text
my (undef, $bugid, $date, $body) = split(/,/, $_, 4);
$comment{$bugid} .= "$date $body ";
}
while (my ($id, $comment) = each %comment){
print "$id, $comment";
}
__DATA__
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
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.