[ACCEPTED]-Remove all whitespaces in a file- Linux-sed
Accepted answer
Depending on your definition of whitespace, something 1 like:
tr -d ' \t\n\r\f' <inputFile >outputFile
would do the trick.
sed 's/\s//g' input.txt | tr -d '\n'
0
sed 's/\s//g'|tr -d '\n'
0
If you have UTF-8 data, best do this:
perl -CS -pe 's/\p{Space}//g' < input > output
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.