Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
APPEND FROM missing a column
Message
De
21/02/2017 06:47:06
 
 
À
20/02/2017 18:46:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows Server 2012 R2
Network:
Windows Server 2012
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01648241
Message ID:
01648265
Vues:
36
>
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform