Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to load a CSV into a DBF in a app
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00503833
Message ID:
00503834
Views:
19
Hi Brenda,

If the number of fields in the CSV is the same as the table, AND if the data types match up across the board, how about

APPEND FROM MyFile.CSV DELIMITED

If they don't, or if the text fields aren't surrounded by quotes, you might try one of the following approaches:
1) Appending the data to a structure that DOES match, SCANning that table and using INSERT INTO statements to populate the desired table; or
2) Appending the data into an array and re-INSERTing in the same manner.

There are several other ways, including FileToStr() and FGETS(), but they take some more coding.

HTH.

>I want to take a comma delimited file and load it into a dbf. the structure of the dbf is already set. I just want to load the file. is there quick and easy way to do it in an app.
>
>thanks
>
>brenda
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Previous
Reply
Map
View

Click here to load this message in the networking platform