I'm trying to remove the whitespace at the end of each line of a text file in ksh.
Im using
sed s/ $//g' file1.txt > file2.txt
It's not working. Any clues?
I'm trying to remove the whitespace at the end of each line of a text file in ksh.
Im using
sed s/ $//g' file1.txt > file2.txt
It's not working. Any clues?
sed 's/ $//' file1.txt > file2.txt # Remove the last space at eol
sed 's/ $//g' file1.txt > file2.txt # Remove all spaces at eol
I don't think that will work. You need
sed 's/ *$//' file1.txt > file2.txt
Oups!
sed 's/ $//' file1.txt > file2.txt # Remove the last space at eol
sed 's/ *$//' file1.txt > file2.txt # Remove all spaces at eol