From: Brian Candler Date: 2009-03-03T23:41:21+09:00 Subject: Re: double quote problem in CSV Salil Gaikwad wrote: > my problem is i am unable to read data correctly when my data-fields > are as follows > "abc", "sdfds"string"ddsfdsf", "xyz", "pqr" > > it gives me error illegal file format at above line. That would be because that line is indeed wrongly formatted. CSV files which have quote-delimited fields must double any quotes which appear with the field. Your line above should be "abc","sdfds""string""ddsfdsf","xyz","pqr" This is the output you'll get if you export as CSV from Excel, for example. So I suggest you fix up your data source to use valid CSV. If it is not valid CSV, you will end up having to write your own parser for it. But there are good reasons for the doubling-up rule. Imagine, for example, what happens if a field contains the sequence quote-comma-quote. How could you distinguish between that being data within one field, or the end of the field and the start of the next one? -- Posted via http://www.ruby-forum.com/.