Monday, March 10, 2008

Remove leading & trailing spaces with Awk


cat file.txt | awk '{for(i=1;i<=NF;i++){printf("%s ",$i)}; print "\n";}'