Hello, I have a list of numbers stored in a file
123
12
12345
1234
1
123
I need them all to be the same number of digits (say 7 digits) with preceeding 0's.
0000123
0000012
0012345
0001234
0000001
0000123
I have done this script using while loops to place zeros until proper number of digits and I have also hard-coded in a case test for the proper string to concatanate to the front of each line.
The problem is, I have a table of 3 columns and 40,000 lines long... it takes too long with all the approaches I've tried.
Is there an easier approach?
I've been looking into sed lately without much luck.
Any help would be wonderful!
2006-07-27
06:22:39
·
5 answers
·
asked by
Jason
2
in
Computers & Internet
➔ Programming & Design