yoda54 has asked for the wisdom of the Perl Monks concerning the following question:
I have a data file in which some of the time the information is split into multiple lines like this:
My question is how can I either 1) combine the multiple lines in advance or 2)join on the fly while reading the files in line by line?somedata data blah \ continuation of previous line \ another continuation of previous line \ stand alone line stand alone line multiple line \ continuation of multiple line
Thanks for any suggestions.while(<F>) { if (multiple line) { #somehow look ahead and collapese } else { #its a single line so just process } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question on parsing a text file.
by jwkrahn (Abbot) on Jan 07, 2010 at 18:06 UTC | |
|
Re: Question on parsing a text file.
by kennethk (Abbot) on Jan 07, 2010 at 17:54 UTC | |
|
Re: Question on parsing a text file.
by BioLion (Curate) on Jan 07, 2010 at 17:55 UTC |