I have a large file with two columns, I would like to interpret the value at 0.00, 0.50, 1.00, 1.50 ...etc (if it is not already exist) by calculating the mean from the previous value and the next value. For instance the corresponding value of 3.00 is missed so I want to add a line with 3.00 in the first column and a corresponding value in the second column =(2.99 + 3.56)/2=3.14 and do the same for 3.50, 4.00 , 4.50 ...etc this is my input
0.00 0.29
0.50 0.79
1.00 1.31
1.50 1.86
2.00 2.42
2.50 2.99
3.25 3.56
3.75 4.15
4.25 4.73
4.75 5.32
5.00 5.92
5.50 6.53
6.00 7.15
and this my desired output
0.00 0.29
0.50 0.79
1.00 1.31
1.50 1.86
2.00 2.42
2.50 2.99
3.00 3.28
3.50 3.86
4.00 4.44
4.50 5.03
5.00 5.92
5.50 6.53
6.00 7.15
x.00
is missing, is it guaranteed that the values for(x-1).75
andx.25
are present? Likewise forx.25
andx.75
ifx.50
is missing?