Well, a crude but effective solution using Perl if a.txt ends with an unwanted newline char:
Code:
$ perl -e 'undef $/; $_ = <STDIN>; s/\n$//; print' <a.txt >new_a.txt
You probably won't want to do that if the file is huge, though, as its entire contents is read into memory all at once.