• Post Reply Bookmark Topic Watch Topic
  • New Topic

File reading  RSS feed

 
Sasikanth Malladi
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I have a file in which lines of integers are separated by commas and I have eight such lines. What's the best way of reading these lines and extracting the integer values from these lines?
thanks,
Sasikanth
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check out the FileReader class and use the ReadLine() method to read a line of the file.
Then use the StringTokenizer class to tokenize the string.

------------------
Regds.
Mahindrakar
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!