[dundee] Parse text file into CSV

Kris Davidson davidson.kris at gmail.com
Thu Dec 10 14:56:57 UTC 2009


Okay I'm looking to turn a directory of text files into a CSV file.
The CSV needs to have 3 columns: title, parapragh, text - with either
each new file being added to the row or getting a newline.

An example text file would look like this (the number of paragraphs is
variable depending on the text file)

-----------------------------------------------------------------------
Title

first paragraph first paragraph first paragraph first paragraph first
paragraph first paragraph etc

second paragraph second paragraph second paragraph second paragraph
second paragraph etc

third paragraph third paragraph third paragraph third paragraph third
paragraph third paragraph third paragraph
-----------------------------------------------------------------------

Colunm 1 needs no explanation, column 2 will be just the first
paragraph in the file, column 3 will be all of paragraphs with
linebreaks being replaced with something say <BR>

Anyway does anyone have idea ideas, command strings or code.

Kris



More information about the dundee mailing list