Tuesday, October 11, 2011

Remove extra spaces from file in linux.

If you found spaces and non-ASCII characters with in files, remove all  from a file in place.

Solution is:
perl -i.bak -pe 's/[^[:ascii:]]//g' filename


Thanks-

4 comments:

Thomas John said...

Hello,

I am Thomas John, representing the website Ubuntu Manual. As the name suggests UM is a site that delivers content related to Ubuntu, its derivatives and related software. We are looking to expand our website and are seeking talented writers familiar with Ubuntu or Linux or similar open source software to include in our community of writers.

We had come across your article on the web and was wondering whether you would be interested in writing for us. We can provide sufficient compensation for your writings and would love to have you as one of our writers.

I will provide you with the rest of the details if you are interested.

Cheers,
--
Thomas John,
Ubuntu Manual

venkat said...


Hats off to your presence of mind..I really enjoyed reading your blog. I really appreciate your information which you shared with us.

Devops Online Training

rose said...

It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command.

Devops Training in Marathahalli|
Devops Training in Bangalore|

Renu said...

Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
Devops Training in electronic city