Making single digit numbers between 1 and 9 into double digits, inside CSV file
6
votes
6
answers
1458
views
I have a CSV file with thousands of lines like these
1664;4;5;35;37;43;5;6
1663;21;23;32;40;49;8;11
1662;16;17;34;35;44;5;10
1661;2;9;23;32;40;6;7
1660;23;25;30;44;47;9;12
1659;3;5;9;32;43;6;10
1658;4;6;10;13;34;3;5
1657;8;9;33;35;40;3;6
1656;15;20;31;44;48;1;3
1655;25;27;35;40;45;7;11
1654;7;32;33;34;38;6;9
1653;5;7;11;27;37;6;12
1652;7;31;33;35;36;7;10
1651;4;12;34;35;45;1;9
1650;5;8;29;35;48;5;6
1649;2;11;28;42;48;4;9
1648;2;11;12;19;38;4;8
You can see that the numbers between 1 and 9 are single digit.
How can I use sed
or something to covert these number into double digit, by preceding a zero to them, such as
01 02 03 04 05 06 07 08 09
instead of
1 2 3 4 5 6 7 8 9
Thanks in advance.
Asked by Duck
(4794 rep)
Sep 4, 2023, 03:04 PM
Last activity: Sep 24, 2023, 11:14 PM
Last activity: Sep 24, 2023, 11:14 PM