Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need some help!!!

 
John Lockheart
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm trying to read data from a text file and use it to fill a matrix. The organization is as follows: The first row has two integers corresponding to rows and columns. The remaining lines of the file contain zero or more values, separated by blank space. Values go into the next available position in the array, filling rows from left to right and moving to the next row when a row is full. There can only be 3 possibilities, ints, a int1*int2 case (value int2 will be used int1 times), and a string (which should just get skipped).





Haven't tried tackling the issue of the "3*5" case yet.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12122
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm sorry, but i don't see what your question is.
 
John Lockheart
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry, i thought i was more explanatory then i was in my comments inside the code. My question was, how would I go about using the first line as paramaters for my vector, then skip it completely when assigning values into my vector?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's also easier to understand what you are asking if you use a more meningful subject title than "need help". Please read this for more info.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic