| | |
Java with String Tokenizer
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2003
Posts: 1
Reputation:
Solved Threads: 0
Hi, I need to import a file with strings and integer values, and use each word i import as a seprate variable. I thought of using String Tokenizer to separate the words and make them 'tokens' but im not sure if that will make them variables and if it will how do i call upon certain variables..
for example
Txt File:
(in a StringTokenizer)
Victoria Baker / 9 / 3 / 195000
how would i call specifically on the 195000 to give it a 4% raise?
thanks
Kait
for example
Txt File:
(in a StringTokenizer)
Victoria Baker / 9 / 3 / 195000
how would i call specifically on the 195000 to give it a 4% raise?
thanks
Kait
I'm not sure what your program design is but it sounds like you'll need to make a seperate class to hold the data within a structure like a tree. So as your tokenizer seperates each token check to see if it's a word or a number then store them in an appropriate object within the tree. If they only need to be in their primitive data type values then maybe you won't need the objects just the check with maybe an if statement to check and then throw it up in the tree structure. any other data structure would work just as well I would assume. An array or stack, queue, linked list. the object would let you call back the variables. I know I haven't been really clear so let me know some more info and I'll try to help more.
![]() |
Similar Threads
- Java's String Tokenizer (Java)
- String Tokenizer? (C++)
- String Tokenizer (Java)
- string tokenizer (Java)
Other Threads in the Java Forum
- Previous Thread: StringTokenizer
- Next Thread: Arrays???
| Thread Tools | Search this Thread |
2dgraphics account android api apple applet application array arrays automation banking binary binarytree bluetooth chat chatprogramusingobjects class classes client code component data database derby design draw eclipse encryption error event exception fractal game givemetehcodez graphics gui html ide if_statement image inheritance input integer interface j2me java javadesktopapplications javaprojects jlabel jni jpanel jtextfield julia linux list loop map method methods midlethttpconnection mobile monitoring netbeans newbie nullpointerexception open-source oracle print printing problem program programming project property recursion reference ria scanner screen search server set size sms sort sourcelabs splash sql static stop string swing testautomation threads time tree ui unicode validation windows





