Welcome to the Java Programming Forums


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.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Reading .txt and storing into an array

  1. #1
    Junior Member
    Join Date
    Sep 2009
    Posts
    24
    My Mood
    Fine
    Thanks
    5
    Thanked 3 Times in 3 Posts

    Default Reading .txt and storing into an array

    So basically, when my program starts, it loads data into an array. I have figured out how to load customer names and numbers by reading from a .txt file and then storing that information into an array. I create an array for each customer so that it can store titles of DVDs that they have borrowed. It's confusing, but I will give an example and try to be more clear.

    When the program starts, customer information from a .txt is loaded into an array. The user is prompted to enter their name and number; the program searches the array for the customer. Let's say the customer enters in 'Jane Doe.' Jane has rented five DVDs, and now she wants to view the DVDs that she has rented.

    So, I am able to load 'Jane' and her number from .txt file into an array, but I have no idea how I can load the DVDs she has rented into an array. The program can take in many customers, and each customer will have rented a different number of DVDs.

    Any ideas/suggestions on how I can execute this will be appreciated!


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 287 Times in 225 Posts
    Blog Entries
    4

    Default Re: Reading .txt and storing into an array

    Hey,

    Please post your code for us to look at. We can take it from there..
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

    Looking for a Java job? Visit - Java Programming Careers

Similar Threads

  1. Reading from RSS server
    By Tisofa in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: August 18th, 2009, 04:04 AM
  2. reading a char with SCANNER
    By lotus in forum Java SE APIs
    Replies: 6
    Last Post: July 29th, 2009, 05:03 AM
  3. reading a sentence
    By lotus in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: July 20th, 2009, 08:29 AM
  4. Object creation from a input file and storing in an Array list
    By LabX in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: May 14th, 2009, 03:52 AM
  5. [SOLVED] Problem in reading a file from java class
    By aznprdgy in forum File I/O & Other I/O Streams
    Replies: 11
    Last Post: March 23rd, 2009, 09:31 AM