Remove white space at the beginning of lines

Hi!

I store some data obtained with grep or awk in a file. The problem is that some lines have white space at the begining :

[w h i t e s p a c e]line1
line2
[whitespace]line3

I use something like
grep WORD INFILE >> OUTFILE
awk [script] >> OUTFILE

I would love if it were possible to remove the white whitout parsing the OUTFILE after the grep or awk command. Is there an option like I could put in the grep or awk saying "keep only what is at left of the white space"?

Any better idea?

Thanks a lot,

Tipi

You could pipe it through a Perl one-liner pretty easily.

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

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

Or with sed:

sed 's/^ *//' file

Try this:
cat INFILE | sed 's/^[ \t]*//' > OUTFILE

Ok, thanks a lot!