in reply to Take file A , translate it, place in new file

might not exactly suit your purposes, but good to be aware of the command-line ability of perl to do this (see perlrun):
perl -i.bak -pe 'tr/a-zA-Z/0-310/; $_ .= "\n"' /tmp/foo.txt
(note: it modifies the original but saves a copy as /tmp/foo.txt.bak)