Editing the first line of file

I have a sample file as below :-

RECORD_COUNT|2660|28606946.86|20110701122349694|
adkad|wwsgesg|mkmk|FFFF|FAFAF|FFAF|FAFFFFA|5894858|

I have to replace the second coulmn in the first row which is the count of no of lines in the file from a new variable .

Also I have to delete the 3rd column in the first row which is the total amount of records in the file from a new variable .

Please help

awk -F"|" -v column2=123 -v column3=123 'NR==1{$2=column2;$3=column3}1' OFS="|" inputfile

If in solaris, use nawk.

--ahamed

If i understand right:

a=123; sed '1{
s/|[0-9]*/|'"$a"'/ 
s/[^|]*|//3
}' INPUTFILE
RECORD_COUNT|123|20110701122349694|
adkad|wwsgesg|mkmk|FFFF|FAFAF|FFAF|FAFFFFA|5894858|