Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, I need to append the next line in a file to the current line if the date is the same. Here is my current code:
foreach $line (@data) { if ( ($line =~ /*disregard this*/)) { # If nextline date = previous line date # Append next line to current line # Else append the value 0
Data is here: Wed,Jun,13,10:40:35,2012 Wed,Jun,13,10:40:35,2012
My apologies for lack of code, but I am looking for a concept more than anything. Thank you.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Append Next Line To Current Line
by daxim (Curate) on Jul 02, 2012 at 17:07 UTC | |
|
Re: Append Next Line To Current Line
by Ransom (Beadle) on Jul 02, 2012 at 17:10 UTC | |
by Anonymous Monk on Jul 02, 2012 at 17:58 UTC | |
by Ransom (Beadle) on Jul 02, 2012 at 18:24 UTC | |
by johngg (Canon) on Jul 02, 2012 at 19:16 UTC | |
by Ransom (Beadle) on Jul 02, 2012 at 19:22 UTC | |
by Anonymous Monk on Jul 02, 2012 at 18:00 UTC | |
|
Re: Append Next Line To Current Line
by Jim (Curate) on Jul 02, 2012 at 18:19 UTC |