Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

count how many tokens are in the first line

 
ben riches
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone i have this code which is below but i am stuck with how i can printout how many tokens are in the first line
could anyone give me some ideas please
thanks
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well it looks like you are processing the entire file, instead of just the first line.
You don't need the

loop if you are only concerned with the number of tokens on the first line.
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see where "v2" is used, I don't see where "hh" is used, ...
Get rid of code which you are not actually using. This will help you understand what you are trying to do.
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would suggest, as a start, that you read in the first line, tokenize it, than print out each token on a seperate line.
You need to understand what you have in "s", before you can start processing it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic