perl -i.bak -pe 'tr/a-zA-Z/0-310/; $_ .= "\n"' /tmp/foo.txt