943,584 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 16020
  • Java RSS
Dec 7th, 2003
0

Java with String Tokenizer

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kait is offline Offline
1 posts
since Dec 2003
Dec 29th, 2003
0

Re: Java with String Tokenizer

Hi :-) First and foremost, is it a fixed format for there be a slash after the name, after the first integer and after the second integer?
Reputation Points: 53
Solved Threads: 1
Posting Whiz
red_evolve is offline Offline
313 posts
since Jun 2003
Feb 3rd, 2004
0

Re: Java with String Tokenizer

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.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
CodeMasterFlex is offline Offline
16 posts
since Feb 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: StringTokenizer
Next Thread in Java Forum Timeline: Arrays???





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC