Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
APPEND FROM missing a column
Message
From
21/02/2017 06:47:06
 
 
To
20/02/2017 18:46:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows Server 2012 R2
Network:
Windows Server 2012
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01648241
Message ID:
01648265
Views:
37
>
>With CSVs, one thing I've done in the past:
>
>- Before importing, read in the file to a string variable using FILETOSTR()
>- Copy the top row (column headers/names) to a separate variable etc. This is everything up to the first carriage return/line feed combination i.e. CHR( 13 ) + CHR( 10 ) . You can then parse that variable to get the column names
>
>Then import normally using the CSV option.
>
>Actually, thinking about it you can get the headers with FILETOSTR() either before or after the CSV import, the timing doesn't matter.

Sounds very inefficient on large files ;-)
Using FGets should always give you nearly linear performance, as only first line is read independant of file size. as long as first line smaller than the 8K limit. For those cases breaking the limit and also very large, alines() on a FRead of 65K should be faster and similarly timed
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform