Hi , i need help with formatting a file i am generating which is to be used in mainframe app so the file length has to be 80 for each rows. The file that m able to generate looks like this (consists of two rows only)
E
1006756
1006756
Active
T
E
0551055
0551055
Active
T
I want the file to be like:
E10067561006756 Active T
E05510550551055 Active T
(the lngth of 3rd fld - 1006756 is 30, so i have 23 space after the number, samewise the length of 4th fld is 30, so i have 24 space after the word "Active". After the word "T", i have 11 more space which is used to be a filler so that we get total 80 as the line size.
How can i ensure this using sed, i have access to shell script.
Thanks in advance for your help.