Remove Whitespace

I am looking to remove all spaces and or tabs from the end of all lines in a text file.
Who is Participating?
ozoConnect With a Mentor Commented:
perl -i.bak -lpe "s/\s+$//" text.file
TintinConnect With a Mentor Commented:
perl -i -ple 's/\s+$//' filename
Note that ozo and I were writing the solution at the same time and ozo hit the submit button before me, so points should go to ozo.
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

or split
stakorAuthor Commented:
I thought I was approving the only answer. Sorry about that. How do I move or split them?
stakorAuthor Commented:
I have requested help for my mistake from the moderators. Sorry about that.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.