Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Print to text file
Message
De
12/06/2009 02:57:22
 
 
À
12/06/2009 02:11:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01405425
Message ID:
01405429
Vues:
60
Use cust
#define crlf Chr(13)+Chr(10)
lcFile='custdata.txt'
Delete File (lcFile)
Scan 
   StrToFile(Left(id,+)+left(name,25)+crlf,lcFile,1)
EndScan
>I have a table:
>
>cust_id character 10
>name character 30
>
>I want to print to text file:
>
>cust_id only print first 6 characters
>name only print first 25 characters
>
>I tried either:
>
>
>SELECT LEFT(cust_id,6),LEFT(name,25) FROM cust TO FILE CUSTDATA
>
>
>or
>
>
>USE cust 
>LIST FIELDS LEFT(cust_id,6)+LEFT(name,25) TO FILE CUSTDATA OFF NOCONSOLE 
>
>
>always has two spaces in front of the text:
>
>
>  XXXXXXYYYYYYYYYYYYYYYYYY
>  XXXXXXYYYYYYYYYYYYYYYYYY
>
>
>while it should be no space ahead:
>
>
>XXXXXXYYYYYYYYYYYYYYYYYY
>XXXXXXYYYYYYYYYYYYYYYYYY
>
>Please advise.
>
>Thanks for the help.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform