I have comma separated file with two columns where the first column is always empty and the second one is sometimes empty (when the last column is empty there is no final comma):
,value_c1_1
,,value_c2_1
,,value_c2_2
,,value_c2_3
,value_c1_2
I would like to use awk to fill empty column value with previous non-empty column value and then get rid of the rows where the second column is empty:
,value_c1_1,value_c2_1
,value_c1_1,value_c2_2
,value_c1_1,value_c2_3
The big difference with the answer to this question
awk '/^ /{$0=(x)substr($0,length(x)+1)}{x=$1}1' file
is that the fields are character separated (instead of being of fixed length) and that the first column is always empty.