Re: Looking for a C program to parse CSV
"Neil Cerutti" <leadvoice@emai l.com> wrote in message
news:slrndlf715 .qs.leadvoice@F IAD06.norwich.e du...[color=blue]
> On 2005-10-19, websnarf@gmail. com <websnarf@gmail .com> wrote:[color=green]
> > vvk4 wrote:[color=darkred]
> >> I have an excel spreadsheet that I need to parse. I was
> >> thinking of saving this as a CSV file. And then reading the
> >> file using C. The actual in EXCEL looks like:
> >> a,b a"b a","b a,",b
> >>
> >> In CSV format looks like:
> >> "a,b","a""b","a "",""b","a,"",b "
> >>
> >> Does anybody have suggestions or have C program based code to
> >> parse CSV.[/color]
> >
> > I'm sorry to see you've gotten such worthless responses to your
> > request before I've managed to come across it.[/color][/color]
....and I helped! (reference to 1960's commercial)
[color=blue]
>
> It's hard to give good answers since csv is not standardized.
> Using a simpler, non-modal data format would be much easier to
> handle. I belive the OP should convert his Excel spreadsheet to
> tab-delimited instead, saving himself the headache.[/color]
Indeed.
But has anyone noticed that the CSV appears wrong. Shouldn't it be
something like:
"a","b a"b a"",""b a,"","b"
NOT
"a,b","a""b","a "",""b","a,"",b " (as posted)
I haven't opened Excel to test this, but the posted code doesn't seem to
scan right.
--
Mabden
"Neil Cerutti" <leadvoice@emai l.com> wrote in message
news:slrndlf715 .qs.leadvoice@F IAD06.norwich.e du...[color=blue]
> On 2005-10-19, websnarf@gmail. com <websnarf@gmail .com> wrote:[color=green]
> > vvk4 wrote:[color=darkred]
> >> I have an excel spreadsheet that I need to parse. I was
> >> thinking of saving this as a CSV file. And then reading the
> >> file using C. The actual in EXCEL looks like:
> >> a,b a"b a","b a,",b
> >>
> >> In CSV format looks like:
> >> "a,b","a""b","a "",""b","a,"",b "
> >>
> >> Does anybody have suggestions or have C program based code to
> >> parse CSV.[/color]
> >
> > I'm sorry to see you've gotten such worthless responses to your
> > request before I've managed to come across it.[/color][/color]
....and I helped! (reference to 1960's commercial)
[color=blue]
>
> It's hard to give good answers since csv is not standardized.
> Using a simpler, non-modal data format would be much easier to
> handle. I belive the OP should convert his Excel spreadsheet to
> tab-delimited instead, saving himself the headache.[/color]
Indeed.
But has anyone noticed that the CSV appears wrong. Shouldn't it be
something like:
"a","b a"b a"",""b a,"","b"
NOT
"a,b","a""b","a "",""b","a,"",b " (as posted)
I haven't opened Excel to test this, but the posted code doesn't seem to
scan right.
--
Mabden
Comment