I need to copy one of the header columns in a fixed width file and create a new field in detail record then paste the field in that placeholder.
Note : There are multiple header and detail records in a file and sample file data with expected output as follows.
Record type : H- Header , D- Detail.
Input:
H0003A
D0001A
D0002A
D0003A
H0007A
D0001A
D0002A
D0003A
D0004A
D0005A
D0006A
D0007A
H0002B
D0001B
D0002B
H0004A
D0001A
D0002A
D0003A
D0004A
Expected output:
H0003A
D0001A3
D0002A3
D0003A3
H0007A
D0001A7
D0002A7
D0003A7
D0004A7
D0005A7
D0006A7
D0007A7
H0002B
D0001B2
D0002B2
H0004A
D0001A4
D0002A4
D0003A4
D0004A4