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:16:55
 
 
To
25/07/2012 11:45:31
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01549228
Message ID:
01549354
Views:
50
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 + ", " + 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.
>
>I had one specific answer to this, years ago, and it was a special delimited text file - but that was an export, and not exactly readable, because each record had a begin/end pair of lines, and inside that pair, each memo had a similar pair of delimiters, plus each ordinary field was a name=value pair. I had one routine which would export the file, another would import. I needed this, because the user had lots of texts of various purposes (hence multiple memos per record), and he wanted a little app to pass on to his contributors, so they'd be able to send him what they did, and he'd be able to incorporate it into his database.
>
>For a readable report, hmmm... maybe generate some html? A simple report wouldn't do.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform