Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copying records on a text file
Message
De
16/01/2009 04:24:39
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
16/01/2009 04:03:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01374284
Message ID:
01374289
Vues:
12
someting like
copy to temp.txt for (last appended or modified) delimited ...
*or
sele * from ... where (last appended or modified) into curhelp
copy to temp.txt delimited ...

strtofile(filetostr('temp.txt'),'Mytext.txt',2)
dele file temp.txt
should do things very fast.

you may also try _VFP.DataToClip(), but a sideefect is that it will override the clipboard and you need to format the string.

All other would mean that you use transform etc to create the string, but I assume you need it generic for different tables so it will be a lot of code to run through.
If it is just a single table with a known (and seldom changed) structure you may try this. But run several thousend records and see whats faster.

Agnes
>I want to append to mytextfile.txt just the last appended or modified record, as it is a background operation and it have to do fast, i'd prefer to avoid to append all the records everytime something happen.
>
>>Allessio,
>>
>>to you like to have all records on the end of Mytext.txt or just a single one?
>>
>>if you need all on the same file then you need just to export all and append them at once.
>>if every record goes to a different file then you still can export all add once and process the result string line by line for example using ALINES()
>>
>>Would be nice to have at least filled the VFP version on the message header, to see the limitations of your VFP.
>>
>>If you like to have only some special records appended you might use COPY TO ... FOR or a SELECT SQL copy to followed by COPY TO to export all records you need at once
>>
>>HTH
>>Agnes
>>
>>>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
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform