This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

StringTokenizer  RSS feed

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any one understand why my token returns an entire line? it totally ignores the "\t" delimeter i set.

My file i'm reading for is tad demlimeted in Excel.

String line = buff.readLine();
for(int y = 0; y < getMaxV(); y++)
StringTokenizer tok = new StringTokenizer(line, "\t");
string = tok.nextToken();
 
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by jite eghagha:
Any one understand why my token returns an entire line? it totally ignores the "\t" delimeter i set.

My file i'm reading for is tad demlimeted in Excel.

String line = buff.readLine();
for(int y = 0; y < getMaxV(); y++)
StringTokenizer tok = new StringTokenizer(line, "\t");
string = tok.nextToken();



Does this mean that you are declaring and initializing the tok variable getMaxV times, and then getting string = tok.nexToken() once?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!