Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy from a Cursor to text file
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01540524
Message ID:
01540531
Views:
31
>>>>Hi,
>>>>
>>>>I need (customer actually) to store data from a cursor into a text file delimited with tab. When use command COPY as
>>>>
>>>>
>>>>SELECT MYCURSOR
>>>>COPY TO MyText.TXT DELIMITED WITH TAB
>>>>
>>>>
>>>>the content of MyText.txt shows each value in quotation marks. My understanding is that the customer wants the data to be in columns of certain length (for each column) and then tab between each column. For example, here is how I think he wants the data:
>>>>
>>>>
>>>>3934447      04/06/2012    100.00       M34444       This is description of item              ABCD            33333
>>>>                                                                                 from memo field
>>>>
>>>>
>>>>Note that all column above (except the one showing date and 100.00 are coming from Character fields. How can I output/store a cursor in the above-type format?
>>>>
>>>>I would appreciate any suggestions.
>>>
>>>Try
>>>
>>>
COPY TO 'TabDelimitedFile.txt' DELIMITED WITH "" WITH CHARACTER TAB
>>
>>Thank you very much. It works! The only thing (and it is not a big deal) is I am trying to figure how to make the first column (which comes from a char field of 15 characters) is aligned to the max width. That is, in my test, the second column (date) is indented from the left margin according to the actual value in the first column.
>
>Hmm, one possibility (I guess) is to append some invisible character that looks like space, e.g. in the cursor instead of select myCharField have something like
>
>select(padr(myCharFiled, 15, chr(7)) && pick the right character here.

I will try it. Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform