cat test.dat | perl -n -e 'chomp; s/^\s+//; s/\s+$//; print "$_\n";' [download]
In reply to Re^2: TRIM in Perl? by Anonymous Monk in thread TRIM in Perl? by peacemaker1820