tags:

views:

33

answers:

3

Hi.. I have several line contains number like:

XXXXXX.XXX (this number ended by whitespace.)

How can I delete whitespace at the end of number format using sed? Thank for the help.

A: 
sed 's/\s\+$//'
Ignacio Vazquez-Abrams
+2  A: 
sed -e 's/\s*$//' in > out

removes any trailing spaces

sed -re 's/^([0-9\.]+)\s*$/\1/' in > out

removes trailing spaces only on line beginning with a combination of digits and dot

RC
A: 
sed 's/[ \t]*$//' file
ghostdog74