Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread
Message: 17949
BY: Michael Silver (masilver)
DATE: 2007-02-12 16:22
SUBJECT: RE: Custom quote string?

 

James, I changed the regular expression used to extract the fields to take a custom string for the quote char instead of ", like it already does for the field separator. I also added an option for the quote character to be passed into the code the same as the other optional params are.

I am unable to write tests to validate what I have, but your tests do pass. I can't write any tests for it as of yet, because I don't understand the test code, nor Ruby's tests, or your class well enough to properly test my changes.

I can give you my code but I would imagine I am missing something big, beyond it failing by passing in an invalid quote separator, and you probably aren't interesting in code that may break your code, understandably. If you still want to look at the changes and critique, I am more than interested.

Currently the modded class suits my needs since I need to read some CSV files with odd separators. Once I better understand how to write tests and the other aspects of your code, I will write the necessary units tests.

...Michael...


Thread View

Thread Author Date
Custom quote string?Michael Silver2007-02-09 06:15
      RE: Custom quote string?James Gray2007-02-09 17:48
            RE: Custom quote string?Michael Silver2007-02-09 18:38
                  RE: Custom quote string?James Gray2007-02-09 18:53
                        RE: Custom quote string?Michael Silver2007-02-12 16:22
                              RE: Custom quote string?James Gray2007-02-12 17:59

Post a followup to this message