in reply to Trailing spaces to lines less than x characters
perl -pe 's/.*/$&." "x(76-$+[0])/e' <infile >outfile [download]
Aaron B. Available for small or large Perl jobs and *nix system administration; see my home node.