Dear RADOULOV,
If awk has a GOD, it is you...
How can I thank you for helping me. I dont have words.
Will you kill me or just ignore me if I ask you to help me with the last formatting request? Please ....
Your code that you wrote together i.e. the one that does both jobs in one go works perfectly. Unfortunately I overlooked and forgot to ask you that the output has to be changed slightly. The first part of your script (If using your code that does both things together) outputs following result.
DATA_444_0 299659.88 2686034.50 -5222.89
DATA_444_0 299646.31 2686026.00 -5226.55
DATA_444_0 299634.50 2686018.50 -5229.11
DATA_444_0 299622.41 2686010.75 -5230.46 <= 2nd and 3rd col from the last row are required in the final result
DATA_451_0 299369.53 2684876.00 -5191.90
DATA_451_0 299357.28 2684869.25 -5194.87
DATA_451_0 299332.78 2684855.50 -5197.94 <= 2nd and 3rd col from the last row are required in the final result
The second part of your your code produces this result, which is perfect (based on my previous request)
DATA_444_0 -7.57 # (-5230.46 - ( -5222.8))
DATA_451_0 -6.04 # (-5197.94 - (-5191.0))
however I want to include the last row's 2nd and 3rd column to this final output for every unique record in the first column. Thus I would want the result instead of above to be like this;
DATA_444_0 299622.41 2686010.75 -7.57 # (2nd and 3rd column comes from the last row of each unique record in the first column)
DATA_451_0 299332.78 2684855.50 -6.04 # (2nd and 3rd column comes from the last row of each unique record in the first column
Note tha thte 2nd and 3rd column in the above result are the last row of each unique record in the first column. Also it would be great if I can have the formatted output of the final result. (not necessary as I can do it as after I get the aove result.... that is all the awk I know...) I hope you will help me as you have done before and I would pray for a healthy, safe and prosperous life for you.
A very newbie to Linux / Unix...