Tuesday, November 30, 2010

Remove the blank space in front of line

cat filename | perl -pe 's/^\s+//'

Note: This will remove any leading whitespace. If the line is all whitespace, the \s+ will capture the newline character.

No comments: