Hi suppose I have a csv file like this
count,1977,1978,1979
usa, , , blue
japan, red, yellow,green
india, , yellow,blue
china, blue, yellow, green
I want the output to be(replace everything, including empty data, with the most recent data):
count,1977,1978,1979
usa, blue, blue, blue
japan, green, green,green
india, blue, blue,blue
china, green, green, green
how to do this in awk? thanks.