Padding zero on vim
Hello,
Today it will be in english ( sorry for spelling mistake :) ).
Imagine you have these account number:
1244
2030923
82398
2379293
020923
02377
2300939
9884
And you want your account number like this:
00003020124
You just need to type this command in vim:
:% s/^\([0-9]*\)$/\printf("%010i",submatch(1))/
Commentaires
Enregistrer un commentaire