Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append text to a CSV file
Message
 
To
21/08/2010 16:00:27
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01477737
Message ID:
01477754
Views:
51
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform