1

I have a file like this:

z E l f
A l t E^ t 
d Y s
m u s t
z E l f s
x @ w e s t
s t e t s
h E p
w i
t E n
o G @
o G @ n
m I s x i n
s t O n t

and I need to remove a space at the end of each line.

How can I do it? Thank you in advance.

user1835630
  • 251
  • 2
  • 6
  • 17
  • possible duplicate of [removing trailing whitespace with sed](http://stackoverflow.com/questions/4438306/removing-trailing-whitespace-with-sed) – i_am_jorf May 16 '13 at 18:32

1 Answers1

2

I assume you want to delete trailing spaces and tabs from the end of each line.

awk '{ sub(/[ \t]+$/, ""); print }' file
Alper
  • 12,860
  • 2
  • 31
  • 41