Export Array fields

Hugues

New Member
Hi All

Here is the code that I use to export a table into CSV, without double quote.

My problem is the addr field is an array field of 2. addr[1] and addr[2]. and the export, concatenate infos of the array without delimiter !!
Code:
OUTPUT TO arsc.tmp.
PUT UNFORMATTED "name " "addr " "city " "state " "zipcd " skip.
FOR EACH arsc NO-LOCK:
    PUT UNFORMATTED  name "|" addr "|" city "|" state "|" zipcd skip.
END.
OUTPUT CLOSE.

example of result:
INFORMATIQUE TEST|1100 rue Jean MarchandAppartement b|Levis|QC|G6V 9G8

I want separate the information of array with semicolon. like this :

INFORMATIQUE TEST|1100 rue Jean Marchand;Appartement b|Levis|QC|G6V 9G8

Any solution please ?

thanks
 
Last edited by a moderator:

tamhas

ProgressTalk.com Sponsor
Did you try
PUT UNFORMATTED name "|" addr[1] "|" addr[2] "|" city "|" state "|" zipcd skip.
 

Casper

ProgressTalk.com Moderator
Staff member
or try something like
Code:
    assign cAddrString = ''.
    do iTmp = 1 to  buffer arsc:buffer-field('addr'):extent:
       assign cAddrString = cAddrString + addr[iTmp] + ';'.
    end.
    assign cAddrString = trim(cAddrString,';').

put unformatted name "|" cAddrString "|" city "|" stated "|" zipcd skip.
 
Top