General information
Category:
Coding, syntax & commands
Hi, Tom. You may put all of this in the category of "well, gee, I already knew that much" :) but here goes. Seems to me that you'd need to use LLFF to read a line and parse for commas (ALINES should work well for that). Then for each element, you could do additional parsing to come up with at least a default data type (e.g. - roughly, " indicates C or M, . indicates N, 2x / or - indicates date, unless also : which indicates datetime, none of the above but all digits indicates I). Of course, you really need to read the entire file, so that you can then determine the max-allowed length of each column.
Seems to me that you may be able to use the code for the VFP import wizard as a shortcut. You should find a file named xsource.zip in your HOME() + 'TOOLS\XSOURCE' folder. In the ZIP file, look for files in the path "VFPSource\Wizards\wzimport."
Kelly
>I need to write a generic program that can examine the structure of a comma seperated file. Once the structure of the has been determined, I will do an APPEND FROM into the cursor that will be created from the first step.
>
>The question is what is the best technique to determine the structure of any CSV file and create a cursor based on that structure for any file that is thrown at the generic import program?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only