I need help in figuring out a script.
We receive a text file with fixed length fields. However, sometimes the last 3 fields aren't used. sometimes it's just the last 2 fields that aren't used.
I need to figure out a way to count the characters in each line and then add spaces on the line to reach 140.
So, for example, if the line comes up to 120 characters long, I have to pad that line with 20 more spaces at the end of the line. If the lines comes up to 138 lines, I have to add 2 more spaces at the end of the line.
Help!
We receive a text file with fixed length fields. However, sometimes the last 3 fields aren't used. sometimes it's just the last 2 fields that aren't used.
I need to figure out a way to count the characters in each line and then add spaces on the line to reach 140.
So, for example, if the line comes up to 120 characters long, I have to pad that line with 20 more spaces at the end of the line. If the lines comes up to 138 lines, I have to add 2 more spaces at the end of the line.
Help!