How to display the first column in a file?

Hi
I need to dispaly only the first column from f1le1 . But i am unable to do with the cut option . Please help me .
The File1 contains the below deatils :

2407765|xyz|774085264795|ABC|2522925531|60.0|01/09/10|CODE1
2408327|xyz|578981547385|ABC|2257881870|60.0|01/09/10| CODE2
2411231|xyz|418015734777|ABC|4433103342|4.99|01/09/10| CODE3
2421246|XYZ|573179911988|ABC|7872431729|60.0|01/09/10| CODE4
2431247|XYZ|833002465502|ABC|0327876658|60.0|01/10/10| CODE4

I need to display only the first column as below . Please guide .

2407765
2408327
2411231
2421246
2431247

What option you have tried with 'cut' ?

awk -F"|" '{print $1}' filename

cut is working to

cut -d "|" -f 1 filename

Or, of course:

sed 's/|.*//' infile

and

grep -o '^[^|]*' infile

But cut and awk are the more obvious choices.

In a shell setting:

while IFS="|" read first rest
do
  printf "$first\n"
done<infile

thanks