Here's a technique I've been using for a long time ...
You should be able to run this code. It creates two reports. First report just prints the original address lines and the second report prints the new label lines.
-*
FILEDEF DATA DISK adr_file.txt
-RUN
-WRITE DATA Information Builders, Inc| | |Two Penn Plaza|New York, NY 10121-2898
-WRITE DATA Information Builders, Inc|Attn: WebFocus | |Two Penn Plaza|New York, NY 10121-2898
-WRITE DATA ReportCaster|Information Builders, Inc|Marketing Department|Two Penn Plaza|New York, NY 10121-2898
-WRITE DATA Information Builders, Inc| |Two Penn Plaza| |New York, NY 10121-2898
-WRITE DATA InfoAssist| |Two Penn Plaza|New York, NY 10121-2898|
-WRITE DATA Information Builders, Inc| |AppStudio|Two Penn Plaza|New York, NY 10121-2898
-WRITE DATA IBI|Two Penn Plaza|New York, NY 10121-2898| |
-WRITE DATA JavaScript|CSS|Two Penn Plaza| |New York, NY 10121-2898
-WRITE DATA Information Builders, Inc| |Attn: HTML |Two Penn Plaza|New York, NY 10121-2898
-WRITE DATA | |FocalPoint|Two Penn Plaza|New York, NY 10121-2898
-CLOSE
-RUN
-*
FILEDEF MASTER DISK adr_file.mas
-RUN
-WRITE MASTER FILENAME=ADR_FILE, SUFFIX=DFIX,$
-WRITE MASTER SEGMENT=ADR_FILE, SEGTYPE=S0,$
-WRITE MASTER FIELDNAME=ADR_L1,,A32,A32,$
-WRITE MASTER FIELDNAME=ADR_L2,,A32,A32,$
-WRITE MASTER FIELDNAME=ADR_L3,,A32,A32,$
-WRITE MASTER FIELDNAME=ADR_L4,,A32,A32,$
-WRITE MASTER FIELDNAME=ADR_L5,,A32,A32,$
-WRITE MASTER FIELDNAME=DELIMITER, ALIAS='|',A01,A01,$
-CLOSE
-RUN
-*
FILEDEF ADR_FILE DISK adr_file.txt
-RUN
-*
DEFINE FILE ADR_FILE
CNTR/I7SC = CNTR + 1;
-*
P_L1/A32 = ADR_L1;
P_L2/A32 = ADR_L2;
P_L3/A32 = ADR_L3;
P_L4/A32 = ADR_L4;
P_L5/A32 = ADR_L5;
-*
P_XL1/A33 = IF P_L1 EQ ' ' THEN ' ' ELSE P_L1 | 'X';
P_XL2/A33 = IF P_L2 EQ ' ' THEN ' ' ELSE P_L2 | 'X';
P_XL3/A33 = IF P_L3 EQ ' ' THEN ' ' ELSE P_L3 | 'X';
P_XL4/A33 = IF P_L4 EQ ' ' THEN ' ' ELSE P_L4 | 'X';
P_XL5/A33 = IF P_L5 EQ ' ' THEN ' ' ELSE P_L5 | 'X';
-*
P_ONELINE/A165 = P_XL1 || P_XL2 || P_XL3 || P_XL4 || P_XL5;
-*
LBL_L1/A32 = SUBSTR(132,P_ONELINE,1,33,32,LBL_L1);
LBL_L2/A32 = SUBSTR(132,P_ONELINE,34,66,32,LBL_L2);
LBL_L3/A32 = SUBSTR(132,P_ONELINE,67,99,32,LBL_L3);
LBL_L4/A32 = SUBSTR(132,P_ONELINE,100,132,32,LBL_L4);
LBL_L5/A32 = SUBSTR(198,P_ONELINE,133,165,32,LBL_L5);
END
-*
TABLE FILE ADR_FILE
PRINT ADR_L1 ADR_L2 ADR_L3 ADR_L4 ADR_L5
BY CNTR
END
-*
TABLE FILE ADR_FILE
PRINT LBL_L1 LBL_L2 LBL_L3 LBL_L4 LBL_L5
BY CNTR
END
-EXIT
WebFocus 8.201M, Windows, App Studio