Hello List, I have input data such as far below:
I would like to read the data into an array and modify the 2nd index if the 0th and first indices are identical. I would like the updated 2nd index to be an average of the 2nd index where both occurences of 0th and 1st indices match. So for example below: The records that contain 24 1 I would like to average the second index 60 and 40 and print the new value like this: ... # print input data 24 1 50 65 24 1 50 65 ... # print rest of input data 22 1 60 65 22 2 180 90 22 3 300 90 23 1 0 65 23 2 90 65 23 3 260 65 24 1 60 65 24 1 40 65 24 2 180 65 24 2 160 65 24 3 310 65 24 3 290 65 25 1 0 90 25 2 120 65 25 3 240 65 26 1 60 65 26 2 180 65 26 3 320 65 87 1 355 65 87 2 100 65 87 3 245 65 87 3 180 65 88 1 100 65 88 2 210 65 88 3 310 65 Thank you in advance.