Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create cvs file from table with memo field
Message
 
To
31/01/2008 15:44:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01287666
Message ID:
01287705
Views:
17
Hi Gaylen,
From VFP BOL
If the file you are creating is not a table, memo fields are not copied to the new file, even if memo field names are included in the field list.

May by
*** This is sample code. Add error handling and adjust to your requirements as necessary.
CREATE CURSOR crsTest (Id Int, CharField C(20), MyMemo M)
INSERT INTO crsTest VALUES (2, [char2], [abracadabra test 222222222])
INSERT INTO crsTest VALUES (1, [char1], [Test test 11111111])
INSERT INTO crsTest VALUES (3, [char3], [Test]+ CHR(13)+CHR(10)+[test 33333])

TxtFile = PUTFILE([Where to save txt])
STRTOFILE([],(TxtFile),.f.)
SCAN
    STRTOFILE(TRANSFORM(id)+[,]+["]+ALLTRIM(CharField)+[","]+MyMemo+["]+CHR(13)+CHR(10),(TxtFile), .t.)
ENDSCAN
MODIFY COMMAND (m.TxtFile) NOEDIT
>When I use copy to xxx delimited, the memo field doesn't get picked up. Any suggestions how I can get the memo field into the comma delimited file.
>
>Thanks
>Gaylen
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Reply
Map
View

Click here to load this message in the networking platform