Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
OS:
Windows Server 2012 R2
Network:
Windows Server 2012
>
>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement