Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with command COPY TO
Message
De
29/10/2001 11:58:15
Charles Richard
Nvo Management Systems
Boisbriand, Québec, Canada
 
 
À
29/10/2001 10:26:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00574504
Message ID:
00574574
Vues:
34
There are two ways that I can thing of. The first delimits with spaces so a space is added to the beginning and the end of each text field. In the second, you choose a character which should never appear in the data and use it to remove the quotation signs. This will be fine as long as there is not much data.

Here are my suggestions:
CREATE CURSOR TEMP (text c(10), num N(5,2), boolean L)
APPEND BLANK
REPLACE text WITH "row1", num WITH 1.1, boolean WITH .T.
APPEND BLANK
REPLACE text WITH "row2", num WITH 2.2, boolean WITH .F.
APPEND BLANK
REPLACE text WITH "row3", num WITH 3.3, boolean WITH .T.

*Method1
COPY TO TEMP1 DELIMITED WITH " "
? "RESULTS method1:"
? FILETOSTR("temp1.txt")

*RESULTS
* row1 ,1.10,T
* row2 ,2.20,F
* row3 ,3.30,T

*Method2
COPY TO TEMP2 DELIMITED WITH "~"
?STRTOFILE(STRTRAN(FILETOSTR("TEMP2.TXT"), "~", ""), "TEMP2.TXT")

? 'RESULTS method2:'
? FILETOSTR("temp2.txt")

*RESULTS
*row1,1.10,T
*row2,2.20,F
*row3,3.30,T
HTH
>Hi everybody
>
>i'm have a problems with command COPY TO.
>
>i'm need export a table visual foxpro delimited fields with , but without "
>
>for example:
>
>file type txt
>name age
>--------------
>"charly","23"
>"holy","43"
>"peter","53"
>
>
>and i need
>
>name age
>--------------
>charly,23
>holy,43
>peter,53
>
>how i can do it?
>thanks
>bye
Charles Richard
NVO Management Systems
crichard@nvo.ca
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform