Hi. I have a fixed width file, that is 62 bytes wide. The first 50 bytes are irrelevant to me. Bytes 51-62 are what I'm interested in, here. Starting in position 51, there is a number that is one to 12 bytes wide. I want to alter the file, padding any non-12-byte number with zeros, to fill out the 12 bytes. So, here's what the file looks like (four record sample):
'[Byte1-50]1234 '
'[Byte1-50]12345 '
'[Byte1-50]123456 '
'[Byte1-50]123456789012'
After running some command (awk, nawk...I don't know...that's the info I'm looking for here), I need the file to look like this:
'[Byte1-50]000000001234'
'[Byte1-50]000000012345'
'[Byte1-50]000000123456'
'[Byte1-50]123456789012'
Anyone think they know how to do this? I'm assuming it's probably not too difficult, I just don't know what the command would be. Thanks in advance!
'[Byte1-50]1234 '
'[Byte1-50]12345 '
'[Byte1-50]123456 '
'[Byte1-50]123456789012'
After running some command (awk, nawk...I don't know...that's the info I'm looking for here), I need the file to look like this:
'[Byte1-50]000000001234'
'[Byte1-50]000000012345'
'[Byte1-50]000000123456'
'[Byte1-50]123456789012'
Anyone think they know how to do this? I'm assuming it's probably not too difficult, I just don't know what the command would be. Thanks in advance!