Separate fields with ';' and get rid of spaces
Posted: Fri Feb 20, 2015 6:06 pm
Hi,
I have a fixed blocked file with lrecl=10 that contains several records with 4 fixed fields.
The 4 fixed fields are in position 1-4,5-6,7,8-10.
I want to combine all the 4 fields and get rid of the spaces to the right of every field and separate them with ';'.
If a fixed field only contains of spaces it should also be separated with ';'.
How do I accomplish that?
Here is how my file with 3 records look like where b=spaces:
So my output-file should consist of:
Hope You understand my problem and can help me.
Mikael
Code'd
I have a fixed blocked file with lrecl=10 that contains several records with 4 fixed fields.
The 4 fixed fields are in position 1-4,5-6,7,8-10.
I want to combine all the 4 fields and get rid of the spaces to the right of every field and separate them with ';'.
If a fixed field only contains of spaces it should also be separated with ';'.
How do I accomplish that?
Here is how my file with 3 records look like where b=spaces:
ABbCCDEFGb
AB1bCbbbbK
bbbbbbJbbb
AB1bCbbbbK
bbbbbbJbbb
So my output-file should consist of:
AB C;CD;F;G
AB1;C;; K
;;J;
AB1;C;; K
;;J;
Hope You understand my problem and can help me.
Mikael
Code'd