MB Software Solutions, LLC wrote on 2012-01-18:
> VFP9SP2
>
> I've got to import a CSV file. Format spelled out by vendor says
> char(30), numeric(12,2), date. Ok. Great. Should be easy. File has
> fields delimited by double quotes. Fine, except that the numeric fields
> are also delimited by quotes. This screws up my simple APPEND FROM
> c:\custfile.csv TYPE CSV command. Ugh.
>
> My initial thought is to change the n(12,2) to varchar(12) and then
> modify the field after the import, but I don't like that idea because I
> want something automated, not something I have to manually adjust.
>
> How do I easily (in code) overcome the vendor's decision to put " around
> ALL fields?!?!?
>
> Thanks in advance!
> --Mike
Mike,
You can automate it.
Create Cursor importcursor (aa c(30), bb c(12), cc d)
Append from getfile("csv")
Alter Table importcursor Column bb n(12,2)
Tracy Pearson
PowerChurch Software
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.