File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Need some help!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need some help!!!" Watch "Need some help!!!" New topic
Author

Need some help!!!

John Lockheart
Ranch Hand

Joined: Oct 13, 2006
Posts: 115
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

Joined: Oct 02, 2003
Posts: 10916
    
  12

i'm sorry, but i don't see what your question is.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
John Lockheart
Ranch Hand

Joined: Oct 13, 2006
Posts: 115
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

Joined: Jan 10, 2002
Posts: 60057
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: Need some help!!!
 
Similar Threads
Need a little help...
unable to exit program..
BufferedReader & StringTokenizer
Manipulating Vectors (code not working)
Blank lines in file throwing exception