Hi Guys,
Hope, you all are doing good out there.
I am writing a shell script and currrint in need of your help.
This is what I need to do;
I have position based plain file. One of the fields is 15 character long. I need to fill that field. The problem is that the value is dynamic, it could be 4, 8, 10, 13 or 15 characters long. It is quite possible that most of the time the value is not 15 character long.
If the value is less than 15, then I need to add the no of exact white spaces to make it up to 15.
For examle, the string is "
ERI-STD-W800I". Here, the length of the string is 13, so I need to add 2 white spaces at the end of it. So, the string will be "
ERI-STD-W800I ".
Can you please help me in achieving this?
A prompt help will be highly appreciated.
Regards,
Chandan Singh
Moderator's Comments:
|
|
Using font changes and bold text do not adequately replace CODE (or ICODE) tags when spacing is important.
|
|