I would like to left pad with "0's" on first column say (width 14)
input.txt17: gdgdgd
117: aa
Need the out put as below
00000000000017: gdgdgd
00000000000117: aa
i have tried the awk -F: '{ printf "%14i: %s\n", $1,$2 }' input.txt
but it's working
padding more than %09i
Nine is not working
try
awk -F: '{ printf "%014i: %s\n", $1,$2 }' input.txt
see here
A leading ‘0’ (zero) acts as a flag that indicates that output should be padded with zeros instead of spaces. This applies only to the numeric output formats. This flag only has an effect when the field width is wider than the value to print.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With