Reputation: 2421
I have a list of numbers (each number having less than 6 digits) in a .tsv file like that :
4559
123
etc
and I need to have a list of numbers of 6 digit like that :
004559
000123
etc
Thanks a lot
Upvotes: 3
Views: 335
Reputation: 94859
There's printf in bash that does exactly this -
printf "%0.6d" $value
Upvotes: 6