 |
Forums |
Admin Discussion Forums: help Start New Thread
By: James Gray
RE: Strict EOL characters [ reply ] 2005-12-19 23:47
|
First, are you aware that you can set the line endings FasterCSV uses?
FasterCSV.open("whatever.csv", :row_sep => "\r\n")
The strictness of the FasterCSV parser is one of the keys to its speed. And, you really aren't allowed to have a \r in an unquoted field, according to the RCF.
That said, this mis-feature is bugging me too. I find myself catching MalformedCSVError often and retrying it with a different line ending. I will add an autodetect line-ending feature to the next version.
Hope that helps.
James Edward Gray II
|
By: Jon Gubman
Strict EOL characters [ reply ] 2005-12-19 22:36
|
Thanks for the module.
I'm having a problem w/ Mac EXCEL users using fastercsv methods however, because of the following lines (Mac Excel apparently uses \r\n as end-of-line).
lines 407-408:
# I decided to take a strict approach to CSV parsing...
if $2.count("\r\n").zero? # verify correctness of field...
Just wondering why be this strict?
|
|
 |