$ cat file x y z $ perl -00pi.~ -e 's/\n<\/tr>\n//g' file $ cat file x y z