mpaler has asked for the wisdom of the Perl Monks concerning the following question:
The contents of record looks like this:wing.chiq wing.chiq.20040417130658 wing.chiq.20040417130727 wing.chiq.20040418184654 woodies.chiq words_with_question_marks.chiq
I'd like to convert this into a CSV row that looks like this:{*JohnDoe* (Wednesday, September 08, 2004, 11:43): A wing is a chemical additive that hastens [[cure]] or chemical reacti +on. For example, cobalt is a wing for [[MEKP]]-catalyzed polyester_r +esin. See, promoted_resin. (_Category_A_) }
I'm leaving in the [word] strings because I can remove those once the text is in csv. I'm also leaving in the "(_Category_A_)" cause it's random... Please note, I forget how to handle large chunks of text that can have commas when converting to csv...do you wrap it in ""? What if there's quotes in the text block? uugh. I'd like the script to read in one file at a time, and save it to a csv file. Any help will be greatly appreciated...wing, JohnDoe, 1094643780, "An accelerator is a chemical additive that + hastens [[cure]] or chemical reaction. For example, cobalt is an ac +celerator for [[MEKP]]-catalyzed polyester_resin. See, promoted_resin +. (_Category_A_)"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: complex text file to csv
by CountZero (Bishop) on Jun 05, 2009 at 06:28 UTC | |
|
Re: complex text file to csv
by GrandFather (Saint) on Jun 05, 2009 at 09:03 UTC | |
by ikegami (Patriarch) on Jun 05, 2009 at 09:10 UTC | |
by GrandFather (Saint) on Jun 05, 2009 at 09:21 UTC | |
by mpaler (Initiate) on Jun 05, 2009 at 17:39 UTC | |
by CountZero (Bishop) on Jun 05, 2009 at 18:10 UTC | |
by mpaler (Initiate) on Jun 07, 2009 at 00:45 UTC |