delete white spaces

hi all...
i have the next question:

i have a flat file with a lot of records (lines). Each record has 10 fields, which are separated by pipe (|). My problem is what sometimes, in the first record, there are white spaces (no values, nothing) in the beginning of the record, like this:

ws ws ws 068|072005|725606|K|3|4|GENERAL 001|S|N|C
068|072005|725606|K|3|4|GENERAL 001|S|N|C
068|072005|725606|K|3|4|GENERAL 001|S|N|C

where ws are white spaces. i have two questons:

(1) �why happens this?
(2) the most important, how can i delete the white spaces�?.

for your help, thanks....

No Idea why you have the spaces, you'd need to look that the source of the files for the reason.

sed s/^[ <tab>]*//' flatfile > newflatfile

where <tab> is an actual tab char.

 tr -d ' ' < filename > newfile

also works if the ws are spaces, not tab characters.