i have a file that contains 288 lines and I need to parse the data and grab various fields, (which is no problem), however I also need to add to the beginning of each line the line number with preceding zeros, (up to 4 characters) at the front of the line number.
EX:
T5041,66.3,11.3,21.9,0.5,23.8,70.9,30.1,6144.0
T5061,64.0,11.2,21.9,2.8,23.8,68.6,173.9,6144.0
T5081,64.0,11.3,21.9,2.8,23.8,68.6,172.8,6144.0
T5101,64.0,11.3,21.9,2.8,23.8,68.6,172.7,6144.0
.
.
.
T5121,63.9,11.2,21.9,2.9,23.8,68.5,179.1,6144.0
.
.
.
T5141,63.9,11.3,21.9,2.9,23.8,68.5,178.5,6144.0
T5161,64.3,11.3,21.9,2.6,23.8,68.9,157.6,6144.0
it should look like:
0001,66.3,11.3,21.9,0.5,23.8,70.9
0002,64.0,11.2,21.9,2.8,23.8,68.6
0003,64.0,11.3,21.9,2.8,23.8,68.6
0004,64.0,11.3,21.9,2.8,23.8,68.6
.
.
.
0056,63.9,11.2,21.9,2.9,23.8,68.5
.
.
.
0198,63.9,11.3,21.9,2.9,23.8,68.5
0199,64.3,11.3,21.9,2.6,23.8,68.9
Could someone point me in the right direction...
EX:
T5041,66.3,11.3,21.9,0.5,23.8,70.9,30.1,6144.0
T5061,64.0,11.2,21.9,2.8,23.8,68.6,173.9,6144.0
T5081,64.0,11.3,21.9,2.8,23.8,68.6,172.8,6144.0
T5101,64.0,11.3,21.9,2.8,23.8,68.6,172.7,6144.0
.
.
.
T5121,63.9,11.2,21.9,2.9,23.8,68.5,179.1,6144.0
.
.
.
T5141,63.9,11.3,21.9,2.9,23.8,68.5,178.5,6144.0
T5161,64.3,11.3,21.9,2.6,23.8,68.9,157.6,6144.0
it should look like:
0001,66.3,11.3,21.9,0.5,23.8,70.9
0002,64.0,11.2,21.9,2.8,23.8,68.6
0003,64.0,11.3,21.9,2.8,23.8,68.6
0004,64.0,11.3,21.9,2.8,23.8,68.6
.
.
.
0056,63.9,11.2,21.9,2.9,23.8,68.5
.
.
.
0198,63.9,11.3,21.9,2.9,23.8,68.5
0199,64.3,11.3,21.9,2.6,23.8,68.9
Could someone point me in the right direction...