Well, like I said, that command will work. A more optimized one might be:
Code:
perl -pe 'BEGIN { $RS = undef; } chomp;' < file > newfile
or even:
Code:
perl -pie 'BEGIN { $RS = undef; } chomp;' file
(that one will overwrite the file in-place instead of having to start working with a new file as well as using built-in perl IO instead of relying on file descriptor redirection)
Anyway, they should be faster, assuming you have perl installed (you probably do) and assuming perl's read/write code is better optimized than the 1-byte-at-a-time dd-based one-liner I suggested above.