Unable to read Tokens

Help~! Once again, my program can work on IDE but not on DOS

I wanted to read the data as token.... like this

while (recordTk.hasMoreTokens()){

System.out.println("Any more token?");

processStr = recordTk.nextToken();

StringTokenizer tk =new StringTokenizer(processStr,"|");

sequence = Integer.parseInt(tk.nextToken());

bidAsk = tk.nextToken();

timeStamp = tk.nextToken();

updateTime = getUpdateString(timeStamp);

tradeSize = Integer.parseInt(tk.nextToken());

tk.nextToken();

priceStr = tk.nextToken();

price = Float.parseFloat(priceStr);

DecimalFormat df =new DecimalFormat("#.000");

String priceString = df.format(price);

amtStr = tk.nextToken();

amountFloat = Float.parseFloat(amtStr);

amountFloat = price * tradeSize;

DecimalFormat df2 =new DecimalFormat("#.");

String amount = df2.format(amountFloat);

but it seems to skip the while loop. I have check the value of the token, it is '4f1d0d'. After this, i have written some codes that insert the data str to the DB but this is being skipped by DOS conveniently as well.

Pls help. hmm i also don't know why DOS and ide can work so differently.... Thanks

[1512 byte] By [peachteaa] at [2007-11-27 4:15:47]
# 1
What is the delimiter u set for "recordTk"... Paste the enite code for reference...
prashu1313a at 2007-7-12 9:22:10 > top of Java-index,Java Essentials,Java Programming...
# 2
Thanks for your response~! StringTokenizer recordTk = new StringTokenizer(value,"\n");
peachteaa at 2007-7-12 9:22:10 > top of Java-index,Java Essentials,Java Programming...
# 3
post the 'value' string and the whole program plz
java_2006a at 2007-7-12 9:22:10 > top of Java-index,Java Essentials,Java Programming...
# 4

public void OnData(String ric, String value, short fid){

if(value!=null){

String var = "";

int sequence;

String bidAsk;

String timeStamp;

String updateTime;

int tradeSize;

float price;

float amountFloat;

//int amount;

String priceStr;

String processStr;

String amtStr = "0";

System.out.println ("hi11");

int insertResult = 0;

ArrayList<Integer> sequenceList;

System.out.println(getCurrTimeStr() + "-> Received update from " + ric);

ric=ric.substring(ric.indexOf('\\')+1);

StringTokenizer ricTk = new StringTokenizer(ric,"-");

ric = ricTk.nextToken();

StringTokenizer recordTk = new StringTokenizer(value,"\n");

System.out.println ("hi12");

System.out.println (recordTk.toString());

while (recordTk.hasMoreTokens()){

System.out.println("Any more token?");

processStr = recordTk.nextToken();

StringTokenizer tk = new StringTokenizer(processStr, "|");

sequence = Integer.parseInt(tk.nextToken());

bidAsk = tk.nextToken();

timeStamp = tk.nextToken();

updateTime = getUpdateString(timeStamp);

tradeSize = Integer.parseInt(tk.nextToken());

tk.nextToken();

priceStr = tk.nextToken();

price = Float.parseFloat(priceStr);

DecimalFormat df = new DecimalFormat("#.000");

String priceString = df.format(price);

amtStr = tk.nextToken();

amountFloat = Float.parseFloat(amtStr);

amountFloat = price * tradeSize;

DecimalFormat df2 = new DecimalFormat("#.");

String amount = df2.format(amountFloat);

boolean x = true;

System.out.println ("hi13");

if (x) {

sequenceList = ricTable.get(ric);

if(sequenceList == null){

sequenceList = new ArrayList <Integer>();

ricTable.put(ric,sequenceList);

}

boolean isInsert = true;

for(Integer i:sequenceList){

if(i.intValue()==sequence){

isInsert = false;

break;

}

}

if(isInsert){

System.out.println ("hi14");

insertResult = db.insertTimesNSales(ric,sequence,updateTime,priceString,tradeSize,bidAsk, amount);

System.out.println("Insert ric: " + ric + " sequence: " + sequence + " result: " + insertResult);

sequenceList.add(sequence);

}

}

}

System.out.println ("hi15");

String msg = ric+";"+value.replace("\n","\r\n");

if(pw!=null){

pw.println(msg);

pw.flush();

}

lastRic = ric;

lastValue = value;

lastFid = fid;

System.out.println ("hi16");

}

}

btw i googled and saw that breakIterator can be used w stringTokenizer. Do u all think it is applicable for my case? Thanks :)

peachteaa at 2007-7-12 9:22:10 > top of Java-index,Java Essentials,Java Programming...
# 5
someone help pls.....:~(sry to keep bugging
peachteaa at 2007-7-12 9:22:10 > top of Java-index,Java Essentials,Java Programming...