I have a file like this:
2733617 3.00 3 3
2733617 E1b1 8.00 8 16
2733617 E1b1b1b 2.00 2 4
2733617 I1 294.00 296 590
2733617 I2 1.00 1 2
2733617 I2a1 2.00 2 4
sed '/^$/d'
does not work for me. Outfile looks just like infile. It should remove empty lines.
Unfortunately the manual says that using ranges like [!-~]
is not safe. However, just printing the lines that containing printable characters using :print:
worked for me in the end:
sed -n '/[[:print:]]/p'
Since there appear to be unknown non-printable characters in the "blank" lines, you could re-write your sed command to only display lines with printable characters in them:
sed -n '/[!-~]/p'
You can also try:
sed -n '/^./p'
which prints only lines which have at least one char at the beginning of the line. (BTW sed '/^$/d'
works for me)