Linux CentOS sed command with regex issues

You may use this perl command to join lines if previous line has a single tab:

perl -i -0777 -pe 's/(\S\t)\n(?!\z)/$1\t/g' excel.log

(?!\z) is a negative lookahead to fail this match for last line of the file.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top