perl -ne 'if (/^/){s/[ \t]+/ /g;print;}' test.txt