Wednesday, 28 August 2013

Parsing multi line text into a CSV

Parsing multi line text into a CSV

pI have a question on parsing a log file into a CSV. The log contains
multiple paragraphs such as the following:/p precodeAB param1: [C of type
1, Dlt;Egt; of type 2, F of type 3] param2: blah param3: [blah blah]
/code/pre pEach of these paragraphs have no spaces between their lines,
but each paragraph is separated from the next paragraph by a blank line.
Essentially, I want to extract information regarding AC. So is there a way
I can parse this into a CSV that looks like the following:/p
precodeAB,C,,1 AB,D,E,2 AB,F,,3 /code/pre pAny ideas? Pearl, Python, SED?
I'm really stumped here, I've never had to parse multiple lines like this,
especially looping on AB like this./p

No comments:

Post a Comment