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-

1 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