Here is a global logic that makes dealing with csv files much nicer
A PARMS($$STRING, $DELIMITER) #DELIMIT = INDEX($$STRING, $DELIMITER) IF #DELIMIT = 0 THEN $$STRING = '' $$PARSED_STRING = '' STEP 1 ENDIF $$PARSED_STRING = $$STRING(1, #DELIMIT - 1) $$STRING = $$STRING(#DELIMIT + LEN($DELIMITER), LEN($$STRING)) STEP 1 1 RETURN($$PARSED_STRING)
PARSE is destructive. Assuming that your file looks like "name", "address 1", "address 2"
You could simply code as follows
$NAME = PARSE($$ASCII_TEXT, ',') $$ADDRESS1 = PARSE($$ASCII_TEXT, ',') $$ADDRESS2 = PARSE($$ASCII_TEXT, ',')We also have a separate global logic REPLACE for character substitution
So, to finish the job,
REPLACE($NAME, '"','') REPLACE($$ADDRESS1, '"', '') REPLACE($$ADDRESS2, '"', '')hth,
- Rob Fantini likes this