Hi,
I want to write a script that does something like this:
I have a file, in which in every line, there is a string of words, and followed by some space, a number.
Quote:
..
nFaces 212;
startFace 8118;
..
Now, I want to identify the line, which has the
largest startFace number (say m=8118), take that number and add it to the number (say n=212) in the line which is just before the line with the largest number, and write the output in the same file, which has the following format
Quote:
..
nFaces 0;
startFace 8330 (m+n);
..
Can anyone help me with this? What is the best options to use here... -sed or AWK?