Hi again. Sorry for all the questions � I've tried to do all this myself but I'm just not good enough yet, and the help I've received so far from bartus11 has been absolutely invaluable. Hopefully this will be the last bit of file manipulation I need to do.
I have a file which is formatted as follows:
ATOM 1 OW SOL X 257 77.820 57.470 97.740 1.00 0.00
ATOM 2 HW1 SOL X 257 77.890 56.840 98.520 1.00 0.00
ATOM 3 HW2 SOL X 257 78.720 57.870 97.550 1.00 0.00
ATOM 4 OW SOL X 258 2.150 71.800 96.120 1.00 0.00
ATOM 5 HW1 SOL X 258 2.940 72.410 96.120 1.00 0.00
ATOM 6 HW2 SOL X 258 2.370 70.970 96.630 1.00 0.00
ATOM 7 OW SOL X 259 46.670 23.720 74.950 1.00 0.00
ATOM 8 HW1 SOL X 259 45.750 24.020 75.180 1.00 0.00
ATOM 9 HW2 SOL X 259 47.040 24.320 74.240 1.00 0.00
ATOM 10 OW SOL X 260 61.950 15.110 16.890 1.00 0.00
ATOM 11 HW1 SOL X 260 61.360 15.690 17.450 1.00 0.00
ATOM 12 HW2 SOL X 260 62.900 15.430 16.960 1.00 0.00
ATOM 13 OW SOL X 261 5.110 14.690 72.070 1.00 0.00
ATOM 14 HW1 SOL X 261 5.290 14.250 72.960 1.00 0.00
ATOM 15 HW2 SOL X 261 4.170 14.500 71.800 1.00 0.00
The coordinates there correspond to water molecules. In column 2 (beginning with 1 and ending with 15) I need to add 5294 to all the numbers and write a new file � or modify the original, but I assume this isn't possible � to give 5295 through 5309. In the third column, which has sets of three of the same five numbers (257 � 261) I need to do something similar, and subtract 126 from all of them (giving 131 � 135).
I should mention that the file itself has many thousands more of these lines, so ideally I need something which is acting on all the numbers in the respective columns. I figured awk but what I've tried isn't capable of handling the numbers as numbers, which is where I'm falling down, so I don't know if something like Python would work, but I've not had much luck there either and don't have much experience with the language.
The reason I need to do this is so that the software I'm using will be able to correctly read the coordinates I'm trying to combine.
Once again any help would be greatly appreciated. Many thanks.