Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy to Delim
Message
De
26/02/2000 22:51:35
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00337856
Message ID:
00338126
Vues:
15
>>using the command copy to C:\DATA\abc.txt TYPE delim with TAB
>>I'm get " " around each field. Tried With Blank. Still get " "
>>Need to get a delim file with out any " " and tab. Is there a trick I'm missing here?
>
>This is a situation I would consider using low level file functions to build the output. If the size of the data is small then you could build the data into a string and simply use STRTOFILE(). For larger datasets then loop through the data and write to file using low level file functions.
>
>Another way to do this using the COPY TO function:
> 1. Add "delimiter" fields to your table to hold the "tab" character
>    fld1...
>    delimit1  C(1)
>    fld2...
>    delimit2  C(1)
>    fld3...
> 2. Populate the delimiter fields with "tab" [chr(9)]
> 3. COPY TO FileName TYPE SDF
>
Good ideas, Michael. That sparked another idea that does not require changing the table structure.

If outputting just character fields,
SELECT field1+CHR(9), field2+CHR(9), field3 ;
FROM table INTO CURSOR temp 
COPY TO FileName TYPE SDF
If non-character must be output,
SELECT TRANSFORM(field1)+CHR(9), ....
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform