Hi.

I'm using a StringTokenizer to read column data, which is seperated by tabs, from a .txt file. And one of the column fields is $18.00. The followings is part of my code.


=====================================

NumberFormat NF = NumberFormat.getInstance();
myStrings = new StringTokenizer(strLine, "\t");

if (myStrings.countTokens()==8) {
ItemNo = new Integer(myStrings.nextToken()).intValue();
System.out.println (ItemNo);
Description = myStrings.nextToken();
System.out.println(Description);
Price = NF.parse(myStrings.nextToken());
System.out(Price);
}
=====================================

The program can show ItemNo and Description on the putput screen when I complie it, but it can't show "Price". Instead, an error message: "Exception in thread "main" java.lang.NumberFormatException: $18.00" comes out.

Would you tell me how to fix it?

Thanks a lot!!!

Jacob