The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

I know how to read in the files using StringTokenizer, I just don't understand what datatype to place everything in because everything I've been working with so far that I've known java is 1D Arrays/Lists. When you have 4, 5, or 6 colums what to can I do when I don't have a DB to hold the information and I need to access it easily. I looked on google and it seemed like I should use a Map or HashMap but I still don't see any examples of how to use one when you have 4 columns of data for each row. If anyone can shield some light on what to do I'd be grateful.

Last edited by jmc117; February 27th, 2013 at 01:15 PM.
Reason: solved

then make my readFile from my driver return an Arraylist of instances of my Product class i assume. After that how do I iterate through my objects? I will want to search by the id for example. i need to figure out how to access my objects from an arraylist..ill google it shortly unless i get a reply. thanks.

Re: Help reading a txt file into a datatype similar to a db

Alright, I'll see what I can do. If I need any more help I'll come back to this thread. I appreciate it. I wasn't able to even think of the idea of an Map/List of objects until you helped me so thanks I should be able to figure it out from here.

--- Update ---

thank you Norm! i got it working with a HashMap and a Product class. Thanks again