Append the end of one line to the start of the next with sed -
i'm looking sed
solutions following:
corrupted input:
a 123 dgbsdgsbg 345 gsgsdgdgs 23 2 afaffaaf 324 fsgdggsdg 345 avsa fasf
expected output:
a 123 dgbsdgsbg 345 gsgsdgdgs 232 afaffaaf 324 fsgdggsdg 345 avsafasf
how can trailing a [0-9].*
appended start of next line. far have:
$ sed -r 's/ (a [0-9]+.*)/\n\1/' file 123 dgbsdgsbg 345 gsgsdgdgs 23 2 afaffaaf 324 fsgdggsdg 345 avsa fasf
this might work (gnu sed):
sed -r '$!n;s/ (a[^\n]*)\n/\n\1/;p;d' file
Comments
Post a Comment