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-