Hi, can anyone help me? This is what i want to do....I have a string
UNB+UNOA:1+OOCLIES+RTTC+080408:0358+1'
and i want to replace the "1" at the end (that specific field only) to 00001 such that the new output will be like this
UNB+UNOA:1+OOCLIES+RTTC+080408:0358+00001'
i tried using sed but it replaces all the "1"'s it encounters..i only need the "1" in the last part....maybe it has something to do with cut -d+ -f6? I'm not entirely sure...
I already figured out how to pad 1 with zeros to make it's width 5 but am having trouble with the replacement part.
Please help anyone...and thank you very much in advance!!!
Hi all, thank you very much for your replies...but can you please explain what happened? Because i can see that you coded it as only "1", but see, these can be any number from 1-99999. what happens is i need to pad the said number with zeros to make it have a width of 5.