Using sed, how would I go about deleting the spaces after the last letter or number in a line? I.E.
Sample Line spspspspspspsp
Where sp is a space on the line and should be replaced with:
Sample Line
I tried using:
sed -e 's/[a-z] *$//g;s/[0-9] *$//g' file
however it cuts off the last letter/number on the line.
Any help would be greatly appreciated.
Thanks,
John
Sample Line spspspspspspsp
Where sp is a space on the line and should be replaced with:
Sample Line
I tried using:
sed -e 's/[a-z] *$//g;s/[0-9] *$//g' file
however it cuts off the last letter/number on the line.
Any help would be greatly appreciated.
Thanks,
John