1 Attachment(s)
Need help with StringTokenizer bad
Hello, I've been trying to figure out stringtokenizer for the past few days and I cannot figure out(and I've tried many many different ways) how to do and where to do my stringtokenizer. I'm going to attach what I have so far just because it will make more sense to see all of the code which I dont want to post all in code tags. The IDE I use is NetBeans as well.
I have to read a file(below) as is and tokenize it, then put it into a stack by either the A or D that comes at the start. Again I am at wick's end and it's really frustrating me that I can't figure out this simple(or rather what seems to be simple) concept. Please let me know if you figure out anything or can steer me in the right direction, Thanks.
This is the text file I have to read from:
Code:
A Trafalgar TTTTT Western_Europe 4 11111
D France
D U.A.E.
A Lapland LLLLL Northern_Europe 4 22222
A Saar SSSSS Western_Europe 3 33333
D Jordan
D India
A Yugoslavia Belgrade Central_Europe 4 44444
D Mongolia
A Yemen Sanaa West_Asia 4 66776
D Ireland
A Spain Madrid Western_Europe 3 33333
D Mongolia