Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Twisting my Melon...
Message
De
31/03/2001 20:00:58
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00490651
Message ID:
00490660
Vues:
12
>Any ideas on how to tackle this one? It's twisting my melon real bad...!
>
>I need to copy to a text file the contents of three tables. The first table contains the first line of the text file - a header. The second table contains multiple lines of information that needs to appear one following the next and the third table contains a footer line.
>
>I have been experimenting with COPY TO WITH DELIMITED BLANK but it is not working on several fronts...
>
>1. I SELECT each table in turn and COPY TO but it overwrites the file each time and I end up with only the footer...
>2. Theresulting text file contains spaces between the fields and character fields have quotes - both of which I need to remove.
>
>I guess what I need to do is either get the data in better shape before writing to the text file or alternatively, find a way of manipulating the text file...

Without knowing your table structures, here are some ideas:

- use COPY TO ... TYPE SDF to get rid of the quotes
- write 3 separate text files with 3 different names
- recombine them using FILETOSTR():
lcString1 = FILETOSTR(<i>TextFile1</i>)
lcString2 = FILETOSTR(<i>TextFile2</i>)
lcString3 = FILETOSTR(<i>TextFile3</i>)

=STRTOFILE(lcString1 + lcString2 + lcString3)
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform