psibi / csv-parser

A CSV Parser in C++ without any bells and whistles
Other
24 stars 9 forks source link

How is this a CSV Parser? #2

Open rakeshgk opened 10 years ago

rakeshgk commented 10 years ago

You are just using a tokenized approach to split the line at commas and return the fields back and not follow the standards of CSV specified in the RFC - http://tools.ietf.org/html/rfc4180

I tested it for one of the valid cases that programs adhering to the RFC standard should support Input 1997,Ford,E350,"Super, luxurious truck"

When I ask for the 4th field to be returned Your program returns - "Super The actual returned value should be - Super, luxurious truck

psibi commented 10 years ago

Yes, the parser fails for these type of inputs. Also, the parser should be able to recognize escape characters and parse them accordingly. This parser also doesn't do that.

Patches are welcome!

rakeshgk commented 10 years ago

Thanks for the confirmation @psibi !!

ssajjan commented 7 years ago

Looks like this code returns the wrong value for the last column values.

Need to reverse the string.

LickBag commented 6 years ago

It doesn't support UNICODE, like Chinese.

LickBag commented 6 years ago

when there is only one column in the csv file, the csv_parser will crash.