problem cutting

echo $line|cut -d " " -f`$plannedCount`-

and this is the output

$ ./read.sh
./read.sh: 12: not found
JADE TRADER 143W MYPEN 40 HC M X10 28 7 1 0
./read.sh: 9: not found
MYPEN 20 GP X X10 15 2 1 0
./read.sh: 9: not found
MYPEN 40 GP X X10 28 7 1 0
./read.sh: 9: not found
MYPEN 20 GP L X10 15 2 1 0
./read.sh: 13: not found
BUNGA TERATAI 3 5055 NZLYT 20 GP X X11 17 8 1 0
./read.sh: 12: not found
MOL SPLENDOR 0307A MUPLU 40 HC X X11 10 2 2 0
./read.sh: 9: not found
MUPLU 40 HC U X11 10 2 1 0

i don't want to s$ ./read.sh
./read.sh: 12: not found
JADE TRADER 143W MYPEN 40 HC M X10 28 7 1 0
./read.sh: 9: not found
MYPEN 20 GP X X10 15 2 1 0
./read.sh: 9: not found
MYPEN 40 GP X X10 28 7 1 0
./read.sh: 9: not found
MYPEN 20 GP L X10 15 2 1 0
./read.sh: 13: not found
BUNGA TERATAI 3 5055 NZLYT 20 GP X X11 17 8 1 0
./read.sh: 12: not found
MOL SPLENDOR 0307A MUPLU 40 HC X X11 10 2 2 0
./read.sh: 9: not found
MUPLU 40 HC U X11 10 2 1 0
[/code]

the output is correct, the only the thing is that it keep having whatever error..

There is a syntax error somewhere in your script. Without the script, we cannot guess what it is.

what you are getting in $line?

I suggest u to use as below

echo $line|cut -d " " -f$(echo $plannedCount)-

or

echo $line|cut -d " " -f`echo $plannedCount`-

Good catch, I missed the backquotes!

I noticed that:
./read.sh: 12: not found
JADE TRADER 143W MYPEN 40 HC M X10 28 7 1 0
./read.sh: 9: not found
MYPEN 20 GP X X10 15 2 1 0

(a) in the first case, 12 is the number of output fields; in the second case, 9 is the number of output fields
(b) this last field is always a 0 (zero)

Are you trying to cut the last field for every line of input?

the last two fields, as a matter of fact