Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying records on a text file
Message
From
16/01/2009 05:39:52
 
 
To
16/01/2009 04:29:40
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01374284
Message ID:
01374297
Views:
28
>>>Hi there,
>>>I'm trying to append singular records in a text file.
>>>As I want to save it in a csv format, appending each record at the end of an existing text file,
>>>Is there a way faster than using "copy to temp.txt next 1 delimited by... "
>>>and then reading this file, get the string and appending it to the Mytext.txt ?
>>>Thank you
>>>Alessio
>>
>>Copy to temp.txt next 1 ... 
>>lcOldfile='Mytext.txt'
>>Strtofile(filetostr(lcOldfile)+chr(13)+chr(10)+filetostr('temp.txt'),lcOldfile,1)
>
>thank you tore, good solution.
>what do you think would be faster ?

Hard to tell, I suggest that you try both yourself, and compare.

>
>Copy to temp.txt next 1 ... 
>lcOldfile='Mytext.txt'
>Strtofile(filetostr(lcOldfile)+chr(13)+chr(10)+filetostr('temp.txt'),lcOldfile,1)
>
>or
>
>Copy to temp.txt next 1 ... 
>lcstr = filetostr('temp.txt')
>lnh = fopen('Mytext.txt')
>=FSEEK(lnh, 0, 2) 
>=fputs(lnh,lcstr)
>=fclose(lnh)
>
>
>thanks
Previous
Reply
Map
View

Click here to load this message in the networking platform