I have a file with a structure
12312 desc: bleh... 9938 desc: blah... desc: bloh... desc: blih... desc: bluh... 9912 desc: blah...
and I want to move the line that matches the "desc:" pattern in the previous line or delete the "\ n" in the line that goes before each "desc:" pattern.
desired result:
12312 desc: bleh... 9938 desc: blah... desc: bloh... desc: blih... desc: bluh... 9912 desc: blah...
I tried
awk '!/desc:/{ printf "%s ",$0 getline printf "%s \n",$0 } /desc/{print}' file
without result.
in fact, all the data is the output of awk -F\" '{print $4 "\t" $6}' maybe I can do something first?
source share