Hi I have a problem, I am attempting to write a bash script that goes through a file and can determine how many characters are at a set point in a line starting with QTY+113:100:PCE, If it detects 3 digits (number in bold) then pad it out with 12 zero's
If there are only two digits then pad it out with 13 zero's, also removing the + and : and adding the correct spacing if possible.
These numbers change, hence why I need it to detect how many characters
QTY+113:100:PCE
I need it to return
QTY 113000000000000100PCE
and if there are two numbers like
QTY+113:50:PCE
I need it to return
QTY 113000000000000050PCE
Any help would be greatly appreciated.