The title already states it:
I want to use some linux one liner (e.g. sed)
to transform
Anytext {
into
Anyt
Using awk
awk
cat file one Anytext { two three { four five {
awk '{printf (!/^{/&&NR>1?RS:x)"%s",$0} END {print ""}' file one Anytext{ two three{ four five{