| Message: 17950 |
 |
BY: James Gray (bbazzarrakk) DATE: 2007-02-12 17:59 SUBJECT: RE: Custom quote string? Michael:
Changing the parsing Regexp is how I started when I tried to add this feature, so I'm pretty sure I know about what you have.
Let me see if I can explain where the problems come in with this approach.
My main reason for adding this feature was to support the semi-common CSV variant that uses \" for escaped quotes. In order to do that though, you have to add an escape for a normal \, which is generally done with \\. So, in order to support this common variant you need to know three thing: the quote character is ", an escaped quote is \", and an addition escape is used as \\ for \.
I found a way to pass all that information into FasterCSV.
The problem then becomes that FasterCSV's Regexp parser chokes and dies on these options. I can write a Regexp to handle the new conditions, but I'm not clever enough to teach the code to do this whenever the rules change in some new way.
Given that, I chose not to support overriding the quote character. I could make it work for some instances, but not all, so adding the feature just seemed like it would cause confusion when it mysteriously didn't work for some set of rules. It seemed better to disallow it altogether.
Hope that makes sense.
James Edward Gray II | |