Hi All,
I am new to tcl/tk programming and need some help on reading and manipulating particular columns in text files. What I need to do is read a text file which has 5 columns of number and add or subtract a user defined number from the last column's value. For example the text file is something like following, and I need to subtract the fifth column values from a user provided number(e.g 70) and write all the columns into a new file.
0 1 300 150 53.57
1 2 5357.5 150 23.1825
2 3 10515 100 30.69992
3 4 15672.5 100 26.03
4 5 20830 200 22.1319
5 6 200 2650 22.15530
6 8 5357.5 2650 28.03
7 9 10515 2650 32.6376
8 0 15672.5 2650 28.9956
I am new to tcl/tk programming and need some help on reading and manipulating particular columns in text files. What I need to do is read a text file which has 5 columns of number and add or subtract a user defined number from the last column's value. For example the text file is something like following, and I need to subtract the fifth column values from a user provided number(e.g 70) and write all the columns into a new file.
0 1 300 150 53.57
1 2 5357.5 150 23.1825
2 3 10515 100 30.69992
3 4 15672.5 100 26.03
4 5 20830 200 22.1319
5 6 200 2650 22.15530
6 8 5357.5 2650 28.03
7 9 10515 2650 32.6376
8 0 15672.5 2650 28.9956