Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append text to a CSV file
Message
 
À
21/08/2010 16:00:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01477737
Message ID:
01477754
Vues:
52
Many thanks for replying....
gives me a few options
regards,
Gerard


>>Hi.
>>I want to append a line of text to the end of a .CSV file.
>>Is there a command to do this ?
>>I will be looping around a table and the .CSV file can be fairly big.....just wonderng if appending to a .CSV table will be as fast
>> as appending to a DBF table.
>
>* Option 1: FileToStr() etc.
>MyNewFile = STRTOFILE( FILETOSTR( MyOldFile ) + CHR( 13 ) + CHR( 10 ) + NewLineOfCharacters )
>
>* Option2: SET ALTERNATE and ?
>* Update system log file:
>SET ALTERNATE TO ( MyOldFile ) ADDITIVE
>SET ALTERNATE ON
>SET CONSOLE OFF
>
>?"Some New Characters"
>
>SET CONSOLE ON
>SET ALTERNATE OFF
>SET ALTERNATE TO
>
>* Option 3: use low level file functions like FOPEN(), FWRITE() etc.
>
No doubt there are other ways. You'll need to experiment if you really feel the need for speed, performance of some of these methods vary depending on file size and size of string to be added.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform