How do I delete the character before the last character in each line in a file?
I tried sed 's/.$//' myfile1.txt
which removed the last character of each line in myfile1.txt
, but I am not sure how to delete the penultimate character in each line.
Best Answer
You can do:
To edit the file in place, without backup:
To edit the file in place, with original file backed up with
.bak
extension:POSIX-ly: