Using awk to interpolate data column based in a data file with date and time
The following file has multiple columns with date, time and incomplete data set as shown using a simple file # Matrix.txt 13.09.2016:23:44:10;;4.0 13.09.2016:23:44:20;10.0; 13.09.2016:23:44:30;; 13.09.2016:23:44:40;30.0;7.0 How can I do an linear interpolation on each column using awk to get the missing data: # Output.txt 13.09.2016:23:44:10;0.0;4.0 13.09.2016:23:44:20;10.0;5.0 13.09.2016:23:44:30;20.0;6.0 13.09.2016:23:44:40;30.0;7.0 Here is one solution in Gnu awk. It runs twice for the first given data file, remembers first and last data points ( y 1 , y 2 ) and their timestamps ( x 2 , x 2