On Feb 26, 12:11 pm, James Gray <
ja...@...> wrote:
> On Feb 26, 2009, at 8:14 AM, BIl Kleb wrote:
>
> > Google et al are failing me: How do I preserve quoted
> > CSV strings on output?
>
> I'm not totally sure I understand the question, but your test made it
> look like your data was one field you wanted to be able to read in.
Sorry for the confusion, my simplified test isn't close enough
to my problem domain ... I'll try again in long form:
I have a CSV file with headers and rows like
"scheme","time_steps","dt"
"1storder",2,0.5
"4thorder",5,1.0
and I am using FasterCSV to read this CSV file to get
a hash of header=>value pairs for each row.
For each row worth of data, I create an output file of the form
&some_weird_name
scheme = "1storder",
time_steps = 2,
dt = 0.5
/
What I'm currently getting is "1storder" without the quotation marks.
I need the data fields to retain their quotation marks like they
have in the original CSV file.
Regards,
--
Bil Kleb
http://fun3d.larc.nasa.govhttp://twitter.com/bil_kleb