angel uc
angel uc

Reputation: 279

how to write the cursor's data in a txt file? visual fox pro

well i have a cursor for example

select col1, col2, col3, col4, colN from cursor into into array thecursor

my current cursor is the cursor

i have got all its data information including null, null information

how can i a txt as it:

col1, col2, col3, col4, colN 
a,b,c,d,e
1,2,3,4,5
a1,b1,,d1,e1
11,12,13,14,
,bb,cc,dd,ee

so you could see at rows a1,b1,,d1,e1 i have a null value between b1 and d1 so you could see i have a null value at row

`11,12,13,14,`(here null value)

and i have a null value at last row

(here null value), cc,dd,ee

so i want this finally txt file

col1, col2, col3, col4, colN 
a,b,c,d,e
1,2,3,4,5
a1,b1,,d1,e1
11,12,13,14,
,bb,cc,dd,ee


**I need this was dynamic i refer it receive a cursor and do it with any cursor

Upvotes: 2

Views: 5123

Answers (2)

Ganapathy
Ganapathy

Reputation: 174

You can directly move the data into a text file instead of cursor as below:

select col1, col2, col3, col4, colN from table to file test.txt

Upvotes: 3

Tamar E. Granor
Tamar E. Granor

Reputation: 3937

Have you looked at the COPY TO command? Try:

COPY TO <filename> TYPE DELIMITED WITH ""

Upvotes: 2

Related Questions