Replacing the last character for each line in a file

That will add a 'z' to the line. To replace the last character using sed:

sed 's/.$/z/' filename