Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create text file with field name + memo file
Message
From
26/07/2012 16:10:34
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01549228
Message ID:
01549352
Views:
31
Seeing there does not seem to be an elegant solution, I did what seemed to be the simplest "brute force" solution.
I created an "NewMemo" field, and then populated it with CustID + memototext(OldMemo).
I now see I should have done ALLTRIM(OldMemo) to get rid of a bunch of trailing spaces.

I then "exported" NewMemo to a text file with:

SCAN.. containing
COPY MEMO newmemo TO textfle.txt ADDITIVE
ENDSCAN

I learned that to use ADDITIVE the file must pre-exist the command.

Thanks for your comment that kept me from wasting more time seeking a "fancy" technique.

It would have been nice if the LIST command would have allowed an .TXT output. It puts it on the screen nicely.
Maybe I could have come up with a redirect command that would have fooled the system into writing to a text file while it thought it was writing to the screen.

Dennis



>>I've been away form VFP for a bit, so I'm a bit rusty, and I can't construct the following.
>>
>>A free table has a customer ID and a memo field with various comments.
>>
>>I want to "export" this to a Text file.
>>
>>IF I use COPY TO... type csv, the memo fields do not show. Do have to apply a function to get them into the csv file?
>>
>>IF I create a report, it shown the memo field when displayed or printed, but when I try to create a text version of the report, the memo field comes across as garbage, not ascii.
>>
>>Other options, or gotchas that I may have missed?
>>
>>Thanks.
>
>If the table is not too big, you can scan it and manually output row by row using low-level file operations or strtofile.
Previous
Reply
Map
View

Click here to load this message in the networking platform