I have several plain text tables (table.txt
), with time series going from 2005
until 2099
. Unfortunately some of them are missing the last day of the time series 31.12.2099
, as follow:
YEAR MONTH DAY RES
2005 1 1 1000
2005 1 2 1001
[...]
2099 12 29 1002
2099 12 30 1003
How can I add the missing day of the time series (31.12.2099
) by pasting the value (RES
) of the previous day?
Considering the minimal example provided, the output should look like that:
YEAR MONTH DAY RES
2005 1 1 1000
2005 1 2 1001
[...]
2099 12 29 1002
2099 12 30 1003
2099 12 31 1003
awk
orperl
? – Mark Plotnick yesterday