If the tail of the split lines always starts with a space (that should be removed), and no other lines do, then this maybe close (wrapped for posting):
perl -nle "if(m[^\s(.*)]){$s.=$1}else{length($s)&print$s;$s=$_;next};END{print$s +}" file >out
In reply to Re: perl one-liner, is it possible?
by BrowserUk
in thread perl one-liner, is it possible?
by hxwu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |