Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Output to Text file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01595465
Message ID:
01595601
Vues:
82
This is simple enough that you can just low level file function to write out what you need exactly. Look through your cursor and just use FWRITE() to write out the lines.

SDF and CSV exports can be really tricky if the format they produce doesn't match. But those formats are so simple that it's just as easy to just write out the values directly using low level file functions which is just a few lines of code too.
lhHandle = FOPEN("output.txt",1)  && Write
FWRITE(lhHandle,"Inventory_partnumber" + CHR(13))
SCAN
      FWrite(lhHandle,TRANS(dataValue))
ENDSCAN
FCLOSE(lhHandle)
+++ Rick ---

>my client requests to print the data to txt file.
>
>the data is:
>
>Inventory_partnumber
>01001
>01002
>
>
>I tried:
>
>COPY TO output1 TYPE SDF
>
>
>I got:
>
>Inventory_partnumber => total 20 characters
>01001                => with extra 15 space
>01002                => with extra 15 space
>
>
>if I used:
>
>COPY TO output1 DELIMITED WITH ''
>
>
>I got:
>
>'Inventory_partnumber' 
>'01001'                            
>'01002'                             
>
>
>while my client requests it has to be no extra space after the value, and no '
>
>is there anyway to do it?
>
>thanks for the help
>
>Regards,
>
>Jerry
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform