I have this sed command which add's 3 zero's to an id (this occurs only if the id is 13 characters long):
sed 's/^\(.\{14\}\)\([0-9]\{13\}[^0-9]\)/\1000\2/' file
My input looks like this:
A:AAAA:AA: :A:**0123456789ABC **:AAA:AAA : :AA: : :
And my output is this one:
A:AAAA:AA: :A:**0000123456789ABC **:AAA:AAA : :AA: : :
I want to get rid off the 3 whitespaces after the id number. I can't delete the entire column because I have different data on other records so I want to delete the spaces just in the records/lines I expanded previously. So maybe I just need to add something to the existing command. As you can see there are other whitespaces on the record, but I just want to delete the ones next to de ID(bold one).
I only found ways to delete entire columns, but I haven't been able to find a way to delete specific characters.