Regex wizards…

how would you join every line ending with :

with the line below it?

Reply to this note

Please Login to reply.

Discussion

Which language? Not possible with standard sed AFAIK.

Can do with standard ed though: echo -e 'g/:$/j\n,p' | ed -s test.txt

If you don't know whether newlines are \n or \r\n: echo -e 'g/:\r*$/j\n,p' | ed -s test.txt

You still would need to get rid of ? below, or use \nw at the end of the command to edit in place.