cron job problem with csh script

I've written a csh shell script to number each line of a file.
Firstly, the program count the number of the file and create a file with number at the front. Then, combine the file together.
when i call the program manually, it works.However, when i set it in the cronjob, the output always leaves 3 numeric blank lines.
Is there somthing wrong for my program deal with cron job?
Thanks for your help.

#combine.x
#!/bin/csh

set ofname=tempa
set oftmp=$1
set oname=$1.txt

@ count=`more $oftmp | wc -l`
@ ll=1

while ( $ll <= $count )
echo $ll"." >> $ofname
@ ll++
end

set formfile="paste -d "\|" $ofname $oftmp"

$formfile > testing.$oname
rm $ofname $oftm

Manually call output: ( $HOME/combine.x abc.log )

1.|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
.......
49.|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
50.|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Cron job Output ( 0,15,30,45 * * * * $HOME/combine.x abc.log > /dev/null 2>&1 )
1.|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
.......
49.|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
50.|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
51.|
52.|
53.|

Could not get your script to work exactly correct, but did note that the only way I would get extra output is if there were extra lines in the original file - if I put an extra blank line in the first file, then I would get an extra line in the final file. Three extra blank lines, three extra lines in the final file.

Check your data in the original file. There may be either three returns in it or something else causing your problem.

Opps, forgot you said "in cron" it added the lines.

Change the line
@ count=`more $oftmp | wc -l`

to

@ count=`cat $oftmp | wc -l`

Ar, it works.

Thanks, thehoghunter.