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 4 of 4

Thread: Text Input into seperate arrays help

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Text Input into seperate arrays help

    Hi

    For a program I'm required to write for uni I need to take an input and split it into seperate arrays. The input is to be like this:

    Word
    Description

    Word
    Description

    ect

    and I need to be able to take all of the words and seperate them then put them in an array, and the same for the description.

    This is my first year of Java programing and I struggle inputing files to arrays. I haven't wrote any code for it yet as I don't have any idea how to do it. Any help would be appreciated.

    Thanks


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Text Input into seperate arrays help

    So how far can you get on your own? Where are you stuck? What do the error messages say?

  3. #3
    Member
    Join Date
    Jun 2012
    Location
    Left Coast, USA
    Posts
    451
    My Mood
    Mellow
    Thanks
    1
    Thanked 97 Times in 88 Posts

    Default Re: Text Input into seperate arrays help

    Quote Originally Posted by CommisarDave View Post
    ...required to write...I need to ...I struggle ...I don't have any idea ...
    If I were given an assignment that required knowledge of subjects that had not been introduced in class notes or textbook assignments or anything else, I would probably try to find tutorial material on the subjects.

    If I had not already completed any programs in Java and I didn't have a text book or class notes with examples, I might start here: Getting Started in Java

    If I had already written a few small assignments (not involving Arrays or Input/Output) and if I were comfortable with the whole process of compiling and executing Java programs, but needed some material that I was not familiar with, I might look at places like the following:

    Arrays Tutorial

    and

    I/O Tutorial

    I would look at examples and copy them, maybe making minor changes so that I could try to understand the details.

    Then, if I found something that I really didn't "get," and if I couldn't find an explanation within the tutorial material, I would post a specific request for specific help along with code that I had tried and along with any compiler error messages or program output that I didn't expect.


    Cheers!

    Z
    Last edited by Zaphod_b; July 23rd, 2012 at 02:22 PM.

  4. #4
    Junior Member
    Join Date
    Jul 2012
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Text Input into seperate arrays help

    thanks I'll check that out. I had searched my textbook I'm using and couldn't find anything but yeah thanks for the links.

Similar Threads

  1. Having trouble splitting a text file into multiple arrays.
    By orbin in forum What's Wrong With My Code?
    Replies: 21
    Last Post: June 19th, 2012, 05:27 PM
  2. sorting input from text files
    By MikeTySUN in forum File I/O & Other I/O Streams
    Replies: 10
    Last Post: January 19th, 2012, 02:53 PM
  3. Allow user input to edit text file??
    By dannyyy in forum Java Theory & Questions
    Replies: 2
    Last Post: April 6th, 2011, 06:53 AM
  4. [SOLVED] Four arrays 32 line characters from text
    By sketch_flygirl in forum Collections and Generics
    Replies: 7
    Last Post: March 31st, 2011, 10:33 PM
  5. Create Multiple Arrays from a text file
    By chris11kgf in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: February 11th, 2011, 12:40 AM