The title already states it:
I want to use some linux one liner (e.g. sed)
to transform
Anytext {
into
Anyt
One way using sed:
sed
sed -ne '$! N; /^.*\n{/ { s/\n//; p; b }; $ { p; q }; P; D' infile
A test. Assuming infile with content:
infile
one Anytext { two three { four five {
Output will be:
one Anytext{ two three{ four five{