Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Importing CSV
Message
 
 
To
16/03/2009 11:51:10
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01388402
Message ID:
01388431
Views:
89
Try to pre-process the file
lcFileName = "c:\dwnld\tabledata.csv"
lcNewFileName = "< whatever >"
STRTOFILE( STRTRAN(FILETOSTR(lcFileName), [,,], [,"",]), lcNewFileName)
APPEND CSV FROM (lcNewFileName)
>I have a CSV file that I am able to download from a company that provides us with electronic invoices. When I open this file in Microsoft Excel, the data is correctly parsed into the columns. If I try to import the same file into VFP using this statement:
>
>append from c:\dwnld\tabledata.csv type csv
>
>into a table that is open, that I have set up with nine columns of character type fields, the data does not parse out correctly. It seems like if a character type item in an original record is empty, VFP 'skips' this column and goes right to the next one. When I look at the line in the original csv file, it looks like this:
>
>
>WDL ,96788853 ,02/24/2009 ,55748761 ,22442061 ,"CURRENT_CHARGES" , ,"5645867" ,"SMITH ,JANE M" ,"00083723" ,01/15/2009 ,"PATH REVIEW, LIQ PAP" ,88141 ,"RLB1" ,"" ,"$25.00"
>
>
>Am I, perhaps, doing something wrong in my VFP syntax?
>
>C
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform