Programmer Question
I have a bunch of pipe-delimited files that weren't properly escaped for carriage returns when generated, and so I cant use the CR or newline characters to delimit the rows. I DO know however that each record has to have exactly 7 fields.
Splitting the fields is easy with the CSV library in Ruby 1.9 setting the 'col_sep' argument, but the 'row_sep' argument cannot be set because I have newlines within the fields.
Is there a way to parse a pipe-delimited file using a fixed number of fields as the row delimiter?
Thanks!
Find the answer here
No comments:
Post a Comment