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.

Page 2 of 2 FirstFirst 12
Results 26 to 45 of 45

Thread: Problems with File Reader (Strings and 2D Array Storage)

  1. #26
    Junior Member
    Join Date
    Dec 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    ^DoH! Ofcourse, silly me!
    Ok, been working on it and I'm wondering which means would be better to reach an end:

    A: I create the following arrays for storage...
    Athlete (Strings) : To hold the heat number, lane, num, athlete name and nationality
    Time (doubles): to hold only the times in order of the above...ie: 1st entry would be Heat 1, Runner 1's time and the final would be Heat 7 runner 8s time.

    or

    B: I use a 3-D Array of [8][9][1]
    each of the 1st postion values would represent the heat and inside the 2nd postion value would be the strings of information and in the third postion would be the time.

    Mayybe I'm over complicating things again lol

    EDIT: Ok, so far this is what I have.
    This is ok so far, because it will store all the info i need, BUT it will only store the final lines data and not the others O_o

    I'm thinking I need a 2D array for this, so that it will store them across the board.
    Does this sound about right? lol

    package coursework1;
     
    import java.lang.*;
    import java.util.*;
    import java.io.*;
    //import java.util.ArrayList;
    //import java.util.List;
     
     
    public class Main {
        //Golbal variables to be accessed by most of my methods
        static String fileName = "";//The file that the user wants to access
        static String [] athlete;
     
        public static void main (String[] args) throws FileNotFoundException{
        Main.body(args);
               }
     
        private static void body (String[] args) throws FileNotFoundException{
        //the bulk of the code/calling will go here, so that main is left with
        //as few calls as possible for ease.
            Main.getFileName(args);
            Main.readLine(args);
            System.out.println("//////////////////////");
            Main.showAthleteArray(args);
        }
     
        private static void getFileName (String[] args)throws FileNotFoundException{
            InputStreamReader input = new InputStreamReader(System.in);
            BufferedReader reader = new BufferedReader(input);
            System.out.println("Please type your file name (including the Extension): ");
            // read in user input
            try {
                fileName = reader.readLine();
                }
            catch(Exception e){}
            System.out.println("\n====CONFIRMATION====\nFile Name: " + fileName + "\n==END CONFIRMATION==\n\n");
                }
     
        private static void printFile (String[]args) throws FileNotFoundException{
             //This will Print the file in its entirety.
             try {
                BufferedReader br = new BufferedReader(new FileReader(fileName));
                String strLine;
                while ((strLine = br.readLine()) != null) {
                    System.out.println(strLine);
                }
                br.close();
            } catch (Exception exc) {
                System.err.println("Error: " + exc.getMessage());
            }
        }
     
        private static void readLine (String[] args) throws FileNotFoundException{
           //it reads the lines and then splits them in seperate lines
            try {
                FileInputStream inStream = new FileInputStream(fileName);
                DataInputStream in = new DataInputStream(inStream);
                BufferedReader br = new BufferedReader(new InputStreamReader(in));
                String line;
     
                //create an array of heats for size 7
                //Heat[] heats = new Heat[7];
                boolean firstHeat = true;
                while ((line = br.readLine()) != null) {
                    if (!line.equals("")) {
                        if (line.trim().startsWith("Heat")) {
                            if (firstHeat) {
                                firstHeat = false;
                            } else {
                                //add old heat to the heat array
                            }
                            //create a new heat object
                        } else {
                            //create new athlete object and add it to the heat
                            athlete = line.trim().split("\\b\\s{2,}\\b");
                            for (int i = 0; i < athlete.length; i++) {
                                System.out.println(athlete[i]);
                            }
                            //System.out.println(line);
                        }
     
                    }
     
                }
                in.close();
            } catch (Exception e) {
                System.err.println("Error: " + e.getMessage());
            }
     
    }
     
        private static void showAthleteArray (String[]args){
            int sum = 0;
            for (int counter = 0; counter < athlete.length; counter++) {
                System.out.println(counter + "\t" + athlete[counter]);
            }
        }
     
    	}

    THIS is the out put of the Athlete array after all methods have executed...(I used my showAthleteArray method to get this)

    0        8
    1        425
    2        Tyler Christopher
    3        CAN
    4        45.15
    Last edited by K0209; January 7th, 2010 at 12:00 PM.

  2. #27
    Junior Member
    Join Date
    Dec 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    Damn double post again, sorry!

    Okay, I tihnk I've managed to get this to store each array of data in an array list, however when I request the data all it prints is "[Ljava.lang.String;@1cfb549" for each positional value.
    *sigh*

    Anyone able to help me with this?

    package coursework1;
     
    import java.lang.*;
    import java.util.*;
    import java.io.*;
    //import java.util.ArrayList;
    //import java.util.List;
     
     
    public class Main {
        //Golbal variables to be accessed by most of my methods
        static String fileName = "";//The file that the user wants to access
        static String [] athlete;//Use as temp Array for data, then move data into a larger arrayList?
        static ArrayList alHeat = new ArrayList();
        static String [] athleteFinal;
     
        public static void main (String[] args) throws FileNotFoundException{
        Main.body(args);
               }
     
        private static void body (String[] args) throws FileNotFoundException{
        //the bulk of the code/calling will go here, so that main is left with
        //as few calls as possible for ease.
            Main.getFileName(args);
            Main.readLine(args);
            System.out.println("//////////////////////");
            Main.showAthleteArray(args);
           [B] System.out.println(alHeat.get(postionalVariableHere));[/B]//**********
        }
     
        private static void getFileName (String[] args)throws FileNotFoundException{
            InputStreamReader input = new InputStreamReader(System.in);
            BufferedReader reader = new BufferedReader(input);
            System.out.println("Please type your file name (including the Extension): ");
            // read in user input
            try {
                fileName = reader.readLine();
                }
            catch(Exception e){}
            System.out.println("\n====CONFIRMATION====\nFile Name: " + fileName + "\n==END CONFIRMATION==\n\n");
                }
     
        private static void printFile (String[]args) throws FileNotFoundException{
             //This will Print the file in its entirety.
             try {
                BufferedReader br = new BufferedReader(new FileReader(fileName));
                String strLine;
                while ((strLine = br.readLine()) != null) {
                    System.out.println(strLine);
                }
                br.close();
            } catch (Exception exc) {
                System.err.println("Error: " + exc.getMessage());
            }
        }
     
        [B]private static void readLine (String[] args) throws FileNotFoundException{
           //it reads the lines and then splits them in seperate lines
            try {
                FileInputStream inStream = new FileInputStream(fileName);
                DataInputStream in = new DataInputStream(inStream);
                BufferedReader br = new BufferedReader(new InputStreamReader(in));
                String line;
     
                //create an array of heats for size 7
                //Heat[] heats = new Heat[7];
                boolean firstHeat = true;
                while ((line = br.readLine()) != null) {
                    if (!line.equals("")) {
                        if (line.trim().startsWith("Heat")) {
                            if (firstHeat) {
                                firstHeat = false;
                            } else {
                                //add old heat to the heat array
                            }
                            //create a new heat object
                        } else {
                            //create new athlete object and add it to the heat
                            athlete = line.trim().split("\\b\\s{2,}\\b");
                            for (int i = 0; i < athlete.length; i++) {
                                int a = 0;
                                System.out.println(athlete[i]);
                                alHeat.add(athlete);
                            }
                            //System.out.println(line);
                        }
                    }
                }
                in.close();
            } catch (Exception e) {
                System.err.println("Error: " + e.getMessage());
            }
     
    }[/B]
     
        private static void showAthleteArray (String[]args){
            int sum = 0;
            for (int counter = 0; counter < athlete.length; counter++) {
                System.out.println(counter + "\t" + athlete[counter]);
            }
        }
     
    	}

    It currently prints out the file with each individual element on a separate line, but I seem unable to store more than the final batch of data O.O;

    EDIT: I'd be pretty content just being able to store ALL the individual lines in one array -- but for the love of me, it seems beyond me >.<
    Last edited by K0209; January 7th, 2010 at 02:04 PM.

  3. #28
    Junior Member
    Join Date
    Jan 2010
    Posts
    18
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    Hey
    Ok first of all, clear up your code a bit
    Get rid of Line 41-54 so as to be able to read the code cleaner. Next, I ran the code, but i don't seem to see where it makes sense. What's with the line that looks like this : //////////////// ?
    and the last line goes from 0-4, but the data next to it just shows the last athlete.
    Re-think your steps and try again. You were on the right track (probably still are :p), but try to write a pseudocode so that you don't do other things which are not relevant to your code.

  4. #29
    Junior Member
    Join Date
    Dec 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    Quote Originally Posted by teen-omar View Post
    Hey
    Ok first of all, clear up your code a bit
    Get rid of Line 41-54 so as to be able to read the code cleaner. Next, I ran the code, but i don't seem to see where it makes sense. What's with the line that looks like this : //////////////// ?
    and the last line goes from 0-4, but the data next to it just shows the last athlete.
    Re-think your steps and try again. You were on the right track (probably still are :p), but try to write a pseudocode so that you don't do other things which are not relevant to your code.
    Sorry, I put in the ////////////'s to help me break up between methods and such...I must've left some in when I cropped. Unless your referring to the System.out.println("/////////////////"); That was put in place so I could originally see where the 'cut up' file ended and the array began.

    With the 0-4, that was part of my ShowArray code, it lists on the left the Array Postion and on the right it shows the value stored... so in that example:

    ///////////////////// (used to seperate the array print out from the file print out)
    0        8
    1        425
    2        Tyler Christopher
    3        CAN
    4        45.15

    Postion '0' holds the information 8 (lane number), '1' holds 425 (num), '2' Tyler..' (name)...etc.
    All I'm trying to get at this point is for it all to store itself as it should (in one array would be fine because then I can still work out the 'winners' of each Heat and print out the relevant data. >.<

    This is making my head hurt lol

  5. #30
    Junior Member
    Join Date
    Jan 2010
    Posts
    18
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    lol mine too
    hmmm....
    you know what I'm seeing? the
    alHeat.add(athlete);
    is actually not doing anything, which means the athlete array is not being placed into the arraylist (which is why the ArrayList is not being used in your code).
    not sure if that helps in any way, but my head is also kinda hurting now:p

  6. #31
    Junior Member
    Join Date
    Dec 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    ^Kinda...
    I wonder if theres anyway to have the code you originally provided store every bit of 'cut' data in a standard array?
    Afterall, it has stored one set of data, even if it stored it all, I would be able to manually sort it.

    I just don;t understand why it takes the first lot of data, then overwrites it...therefore only storing the last data entered. I tried manually adjusting the array size to see if this would help and also tried (and failed) to implement a 2D array...but it wouldn;t accept it. **cnfused** lol

    Thanks for sticking with this teen-omar, it is greatly appreciated ^^

  7. #32
    Junior Member
    Join Date
    Jan 2010
    Posts
    18
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    Well you see the comment i provided you with in the code should have helped you a little ;-)
    ok, think outside the box, take the work your teacher gave you and have a look at it. Try to find any similarities you can and adjust it to your code.
    Hope that helps, because if the teacher told you that everything is in that code and you still don't come up with the answer, then you are not to blame, but the teacher
    By the way, have you written a test plan for what you are doing? because this will help you a great deal in terms of breaking down the tasks into smaller chunks

  8. #33
    Junior Member
    Join Date
    Jan 2010
    Posts
    18
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    Well you see the comment i provided you with in the code should have helped you a little ;-)
    ok, think outside the box, take the work your teacher gave you and have a look at it. Try to find any similarities you can and adjust it to your code.
    Hope that helps, because if the teacher told you that everything is in that code and you still don't come up with the answer, then you are not to blame, but the teacher
    By the way, have you written a test plan for what you are doing? because this will help you a great deal in terms of breaking down the tasks into smaller chunks

  9. #34
    Junior Member
    Join Date
    Dec 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    Quote Originally Posted by teen-omar View Post
    Well you see the comment i provided you with in the code should have helped you a little ;-)
    ok, think outside the box, take the work your teacher gave you and have a look at it. Try to find any similarities you can and adjust it to your code.
    Hope that helps, because if the teacher told you that everything is in that code and you still don't come up with the answer, then you are not to blame, but the teacher
    By the way, have you written a test plan for what you are doing? because this will help you a great deal in terms of breaking down the tasks into smaller chunks
    Lol I did see the comments and did build upon them somewhat, however I partially thought that you may have removed them from the final product because they didn't work lol

    My basic 'idea' of how the code is to work is this...

    -request FileName (DONE)
    -Open file (DONE)
    -Read File and Store as relevant (where I'm stuck)
    -Use stored data and print out 3 fastest runners in each heat (simple, when I have it stored)

    Naturally this could be in far smaller chunks, but I'm not familiar with the FileReader/BufferedReader/String Splitting etc etc to practically do that >.<

    I will take another look, at the afore mentioned code and try and see if I can get it to work -- damn, I was hoping to have had this done by the weekend lol XD

  10. #35
    Junior Member
    Join Date
    Jan 2010
    Posts
    18
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    well the weekend isn't over yet
    Try breaking it down into smaller chunks
    ok Open file is done no need to look at that.
    But let's look closer at the next step.
    First we have to make sure that whenever the program sees a Heat (1,2,3 etc) it creates an Array for it, which consists of Athletes.
    Then it should skip the next line which says Nat, Num etc.
    Then your next line should be read and stored in an array in the form that every data is given its right type i.e. [int num, int lane...] etc.
    So visually i would be like: [ HEAT[ATHLETE[Name,Num etc.] ] ]
    So kind of like Arrays within Arrays (Hint!) lol
    once that is done, all you want is to find the last double (time) and use that as the "tag" of the athlete. Next you are going to sort the Arrays in terms of those "tags" and find in every Heat the 3 fastest. How you're going to do it I don't know :p.
    Next you are going to look at the ALL Heats and find the next 3 fastest runners, which means that you are going to have to eliminate the 3 fastest runners from all heats i.e. 21 all together.
    Then you add those 3 second fastest runners to the list of the 21 and BAAAMM that's your list :p
    Now try to work it out in terms of coding ^_^

  11. #36
    Junior Member
    Join Date
    Jan 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    Ko209, read the blue book that Artie gave you

  12. #37
    Junior Member
    Join Date
    Jan 2010
    Posts
    18
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    Hey MrE, I am assuming you attend the same University as Ko209
    any help in doing the project maybe?
    let us know so we can put him out of his misery :p

  13. #38
    Junior Member
    Join Date
    Dec 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    @MrE, an identity would be nice to put with the username
    As for the Blue Book, I have read it cover to cover. While it outlines it with the account example it contains too many variables specific to the Account program rather than showing 'what the FileReader can do and how to do it', it doesn't give me much information as to how to break it to what I need -- lord knows I've tried

    @teen-omar: yes, misery, end it please lol

    Still working on the code, will post it up when I have made changes/hit a wall ^^

  14. #39
    Junior Member
    Join Date
    Dec 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    I've been hitting my head against the wall with this today lol
    I've been experimenting with ArrayLists and 2D arrays.

    I feel a series of 2D arrays would work more in my favor...because the Array itself could represent an individual heat and that inside could contain Arrays to hold the formatted information from the lines...ie..

    Heat 1 [[num, nat, name, time],[num, nat, name, time],[num, nat, name,time]...etc]

    I could then arrange the Athletes inside by the value of the time, the ones with the lowest time at postion [0][0] and the ones with the higher ones at [0][arr.length] the end. This way, I could easilt Print the first three values in each array Heat.

    Then if I were to arrange THOSE winners by their speed...I could use the Heat arr positions once arranged and 'copy' them into a new arr called...i don;t know...HeatFinalists, then I could arrange them as above and print.

    Does that sound about right?
    I STILL can't get them to store though. >.<

    Method currently working on... BEFORE crazy non-working changes lol

    private static void readLine (String[] args) throws FileNotFoundException{
           //it reads the lines and then splits them in seperate lines
            try {
                FileInputStream inStream = new FileInputStream(fileName);
                DataInputStream in = new DataInputStream(inStream);
                BufferedReader br = new BufferedReader(new InputStreamReader(in));
                String line;
     
                boolean firstHeat = true;
                while ((line = br.readLine()) != null) {
                    if (!line.equals("")) {
                        if (line.trim().startsWith("Heat")) {
                            if (firstHeat) {
                                firstHeat = false;
                            } else {
                                //add old heat to the heat array
                            }
                            //create a new heat object
                        } else {
                            //create new athlete object and add it to the heat
                            athlete = line.trim().split("\\b\\s{2,}\\b");
                            for (int i = 0; i < athlete.length; i++) {
                            //for (int i = 0; i < athlete.length; i++) {
                                //System.out.println(athlete[i]);
                             }
                           }
                    }
                }
                in.close();
            } catch (Exception e) {
                System.err.println("Error: " + e.getMessage());
            }
     
    }

  15. #40
    Junior Member
    Join Date
    Jan 2010
    Posts
    18
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    Hey
    i see that you haven't made any changes to the current code. guess you're still stuck
    Have you asked MrE if he can give you any more hints than just "looking into the blue book"?
    Maybe it does actually reveal something very important and interesting in it.... hmmm

  16. #41
    Junior Member
    Join Date
    Jan 2010
    Posts
    18
    Thanks
    0
    Thanked 3 Times in 2 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    Hey, I saw that you requested some help for you Java code on another forum

    Reading from File and Storing in Array [HELP] - CodeGuru Forums
    Seems like the guy who responded could help out, just write out the pseudo code for him so he gets an idea of what's going on. Something like this:
    "ok Open file is done no need to look at that.
    But let's look closer at the next step.
    First we have to make sure that whenever the program sees a Heat (1,2,3 etc) it creates an Array for it, which consists of Athletes.
    Then it should skip the next line which says Nat, Num etc.
    Then your next line should be read and stored in an array in the form that every data is given its right type i.e. [int num, int lane...] etc.
    So visually i would be like: [ HEAT[ATHLETE[Name,Num etc.] ] ]
    So kind of like Arrays within Arrays (Hint!) lol
    once that is done, all you want is to find the last double (time) and use that as the "tag" of the athlete. Next you are going to sort the Arrays in terms of those "tags" and find in every Heat the 3 fastest. How you're going to do it I don't know :p.
    Next you are going to look at the ALL Heats and find the next 3 fastest runners, which means that you are going to have to eliminate the 3 fastest runners from all heats i.e. 21 all together.
    Then you add those 3 second fastest runners to the list of the 21 and BAAAMM that's your list"

  17. #42
    Junior Member
    Join Date
    Jan 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    Haha I wish. I'm not even half as far as K0209 is! You're right the blue book is too vague, I just said that to joke with you. I know i'm not very helpful, but you don't mind me sampling bits and pieces do you? i'm a little stuck myself and Tuesday is approaching.

  18. #43
    Junior Member
    Join Date
    Dec 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    Ok, I thought this would work, but it didn't ><

        private static void printFile (String[]args) throws FileNotFoundException{
             //This will Print the file in its entirety.
             try {
                BufferedReader br = new BufferedReader(new FileReader(fileName));
                String strLine;
                while ((strLine = br.readLine()) != null) {
                    System.out.println(strLine);
                }
                br.close();
            } catch (Exception exc) {
                System.err.println("Error: " + exc.getMessage());
            }
        }
     
        private static void readLine (String[] args) throws FileNotFoundException{
           //it reads the lines and then splits them in seperate lines
            try {
                FileInputStream inStream = new FileInputStream(fileName);
                DataInputStream in = new DataInputStream(inStream);
                BufferedReader br = new BufferedReader(new InputStreamReader(in));
                String line;
     
                boolean firstHeat = true;
                while ((line = br.readLine()) != null) {
                    if (!line.equals("")) {
                        if (line.trim().startsWith("Heat")) {
                            if (firstHeat) {
                                firstHeat = false;
                            } else {
                                //add old heat to the heat array
                            }
                            //create a new heat object
                        } else {
                            //create new athlete object and add it to the heat
                            String [] athlete = line.trim().split("\\b\\s{2,}\\b");
                            for (int i = 0; i < athlete.length; i++) {
                            //for (int i = 0; i < athlete.length; i++) {
                                //System.out.println(athlete[i]);
                                heatsL.add(athlete);
     
                             }
                           }
                    }
                }
                in.close();
                } catch (Exception e) {
                System.err.println("Error: " + e.getMessage());
            }
     
    }

    heatL is a global variable ArrayList.
    After ReadLine is executed I try to print the ArrayList and this is what I get O_o

    [[Ljava.lang.String;@1034bb5, [Ljava.lang.String;@1034bb5, [Ljava.lang.String;@1034bb5, [Ljava.lang.String;@1034bb5, [Ljava.lang.String;@1034bb5, [Ljava.lang.String;@15f5897, [Ljava.lang.String;@15f5897, [Ljava.lang.String;@15f5897, [Ljava.lang.String;@15f5897, [Ljava.lang.String;@15f5897, [Ljava.lang.String;@b162d5, [Ljava.lang.String;@b162d5, [Ljava.lang.String;@b162d5, [Ljava.lang.String;@b162d5, [Ljava.lang.String;@b162d5, [Ljava.lang.String;@1cfb549, [Ljava.lang.String;@1cfb549, [Ljava.lang.String;@1cfb549, [Ljava.lang.String;@1cfb549, [Ljava.lang.String;@1cfb549, [Ljava.lang.String;@186d4c1, [Ljava.lang.String;@186d4c1, [Ljava.lang.String;@186d4c1, [Ljava.lang.String;@186d4c1, [Ljava.lang.String;@186d4c1, [Ljava.lang.String;@f9f9d8, [Ljava.lang.String;@f9f9d8, [Ljava.lang.String;@f9f9d8, [Ljava.lang.String;@f9f9d8, [Ljava.lang.String;@f9f9d8, [Ljava.lang.String;@1820dda, [Ljava.lang.String;@1820dda, [Ljava.lang.String;@1820dda, [Ljava.lang.String;@1820dda, [Ljava.lang.String;@1820dda, [Ljava.lang.String;@15b7986, [Ljava.lang.String;@15b7986, [Ljava.lang.String;@15b7986, [Ljava.lang.String;@15b7986, [Ljava.lang.String;@15b7986, [Ljava.lang.String;@87816d, [Ljava.lang.String;@87816d, [Ljava.lang.String;@87816d, [Ljava.lang.String;@87816d, [Ljava.lang.String;@87816d, [Ljava.lang.String;@422ede, [Ljava.lang.String;@422ede, [Ljava.lang.String;@422ede, [Ljava.lang.String;@422ede, [Ljava.lang.String;@422ede, [Ljava.lang.String;@112f614, [Ljava.lang.String;@112f614, [Ljava.lang.String;@112f614, [Ljava.lang.String;@112f614, [Ljava.lang.String;@112f614, [Ljava.lang.String;@1d9dc39, [Ljava.lang.String;@1d9dc39, [Ljava.lang.String;@1d9dc39, [Ljava.lang.String;@1d9dc39, [Ljava.lang.String;@1d9dc39, [Ljava.lang.String;@93dcd, [Ljava.lang.String;@93dcd, [Ljava.lang.String;@93dcd, [Ljava.lang.String;@93dcd, [Ljava.lang.String;@93dcd, [Ljava.lang.String;@b89838, [Ljava.lang.String;@b89838, [Ljava.lang.String;@b89838, [Ljava.lang.String;@b89838, [Ljava.lang.String;@b89838, [Ljava.lang.String;@111a3ac, [Ljava.lang.String;@111a3ac, [Ljava.lang.String;@111a3ac, [Ljava.lang.String;@111a3ac, [Ljava.lang.String;@111a3ac, [Ljava.lang.String;@110b053, [Ljava.lang.String;@110b053, [Ljava.lang.String;@110b053, [Ljava.lang.String;@110b053, [Ljava.lang.String;@110b053, [Ljava.lang.String;@a83b8a, [Ljava.lang.String;@a83b8a, [Ljava.lang.String;@a83b8a, [Ljava.lang.String;@a83b8a, [Ljava.lang.String;@a83b8a, [Ljava.lang.String;@dd20f6, [Ljava.lang.String;@dd20f6, [Ljava.lang.String;@dd20f6, [Ljava.lang.String;@dd20f6, [Ljava.lang.String;@dd20f6, [Ljava.lang.String;@19efb05, [Ljava.lang.String;@19efb05, [Ljava.lang.String;@19efb05, [Ljava.lang.String;@19efb05, [Ljava.lang.String;@19efb05, [Ljava.lang.String;@723d7c, [Ljava.lang.String;@723d7c, [Ljava.lang.String;@723d7c, [Ljava.lang.String;@723d7c, [Ljava.lang.String;@723d7c, [Ljava.lang.String;@22c95b, [Ljava.lang.String;@22c95b, [Ljava.lang.String;@22c95b, [Ljava.lang.String;@22c95b, [Ljava.lang.String;@22c95b, [Ljava.lang.String;@1d1acd3, [Ljava.lang.String;@1d1acd3, [Ljava.lang.String;@1d1acd3, [Ljava.lang.String;@1d1acd3, [Ljava.lang.String;@1d1acd3, [Ljava.lang.String;@a981ca, [Ljava.lang.String;@a981ca, [Ljava.lang.String;@a981ca, [Ljava.lang.String;@a981ca, [Ljava.lang.String;@a981ca, [Ljava.lang.String;@8814e9, [Ljava.lang.String;@8814e9, [Ljava.lang.String;@8814e9, [Ljava.lang.String;@8814e9, [Ljava.lang.String;@8814e9, [Ljava.lang.String;@1503a3, [Ljava.lang.String;@1503a3, [Ljava.lang.String;@1503a3, [Ljava.lang.String;@1503a3, [Ljava.lang.String;@1503a3, [Ljava.lang.String;@1a1c887, [Ljava.lang.String;@1a1c887, [Ljava.lang.String;@1a1c887, [Ljava.lang.String;@1a1c887, [Ljava.lang.String;@1a1c887, [Ljava.lang.String;@743399, [Ljava.lang.String;@743399, [Ljava.lang.String;@743399, [Ljava.lang.String;@743399, [Ljava.lang.String;@743399, [Ljava.lang.String;@e7b241, [Ljava.lang.String;@e7b241, [Ljava.lang.String;@e7b241, [Ljava.lang.String;@e7b241, [Ljava.lang.String;@e7b241, [Ljava.lang.String;@167d940, [Ljava.lang.String;@167d940, [Ljava.lang.String;@167d940, [Ljava.lang.String;@167d940, [Ljava.lang.String;@167d940, [Ljava.lang.String;@e83912, [Ljava.lang.String;@e83912, [Ljava.lang.String;@e83912, [Ljava.lang.String;@e83912, [Ljava.lang.String;@e83912, [Ljava.lang.String;@1fae3c6, [Ljava.lang.String;@1fae3c6, [Ljava.lang.String;@1fae3c6, [Ljava.lang.String;@1fae3c6, [Ljava.lang.String;@1fae3c6, [Ljava.lang.String;@7ffe01, [Ljava.lang.String;@7ffe01, [Ljava.lang.String;@7ffe01, [Ljava.lang.String;@7ffe01, [Ljava.lang.String;@7ffe01, [Ljava.lang.String;@fd13b5, [Ljava.lang.String;@fd13b5, [Ljava.lang.String;@fd13b5, [Ljava.lang.String;@fd13b5, [Ljava.lang.String;@fd13b5, [Ljava.lang.String;@118f375, [Ljava.lang.String;@118f375, [Ljava.lang.String;@118f375, [Ljava.lang.String;@118f375, [Ljava.lang.String;@118f375, [Ljava.lang.String;@117a8bd, [Ljava.lang.String;@117a8bd, [Ljava.lang.String;@117a8bd, [Ljava.lang.String;@117a8bd, [Ljava.lang.String;@117a8bd, [Ljava.lang.String;@471e30, [Ljava.lang.String;@471e30, [Ljava.lang.String;@471e30, [Ljava.lang.String;@471e30, [Ljava.lang.String;@471e30, [Ljava.lang.String;@10ef90c, [Ljava.lang.String;@10ef90c, [Ljava.lang.String;@10ef90c, [Ljava.lang.String;@10ef90c, [Ljava.lang.String;@10ef90c, [Ljava.lang.String;@a32b, [Ljava.lang.String;@a32b, [Ljava.lang.String;@a32b, [Ljava.lang.String;@a32b, [Ljava.lang.String;@a32b, [Ljava.lang.String;@1d8957f, [Ljava.lang.String;@1d8957f, [Ljava.lang.String;@1d8957f, [Ljava.lang.String;@1d8957f, [Ljava.lang.String;@1d8957f, [Ljava.lang.String;@3ee284, [Ljava.lang.String;@3ee284, [Ljava.lang.String;@3ee284, [Ljava.lang.String;@3ee284, [Ljava.lang.String;@3ee284, [Ljava.lang.String;@8965fb, [Ljava.lang.String;@8965fb, [Ljava.lang.String;@8965fb, [Ljava.lang.String;@8965fb, [Ljava.lang.String;@8965fb, [Ljava.lang.String;@867e89, [Ljava.lang.String;@867e89, [Ljava.lang.String;@867e89, [Ljava.lang.String;@867e89, [Ljava.lang.String;@867e89, [Ljava.lang.String;@1dd7056, [Ljava.lang.String;@1dd7056, [Ljava.lang.String;@1dd7056, [Ljava.lang.String;@1dd7056, [Ljava.lang.String;@1dd7056, [Ljava.lang.String;@fa3ac1, [Ljava.lang.String;@fa3ac1, [Ljava.lang.String;@fa3ac1, [Ljava.lang.String;@fa3ac1, [Ljava.lang.String;@fa3ac1, [Ljava.lang.String;@276af2, [Ljava.lang.String;@276af2, [Ljava.lang.String;@276af2, [Ljava.lang.String;@276af2, [Ljava.lang.String;@276af2, [Ljava.lang.String;@1de3f2d, [Ljava.lang.String;@1de3f2d, [Ljava.lang.String;@1de3f2d, [Ljava.lang.String;@1de3f2d, [Ljava.lang.String;@1de3f2d, [Ljava.lang.String;@5d173, [Ljava.lang.String;@5d173, [Ljava.lang.String;@5d173, [Ljava.lang.String;@5d173, [Ljava.lang.String;@5d173, [Ljava.lang.String;@1f9dc36, [Ljava.lang.String;@1f9dc36, [Ljava.lang.String;@1f9dc36, [Ljava.lang.String;@1f9dc36, [Ljava.lang.String;@1f9dc36, [Ljava.lang.String;@e86da0, [Ljava.lang.String;@e86da0, [Ljava.lang.String;@e86da0, [Ljava.lang.String;@e86da0, [Ljava.lang.String;@e86da0, [Ljava.lang.String;@1754ad2, [Ljava.lang.String;@1754ad2, [Ljava.lang.String;@1754ad2, [Ljava.lang.String;@1754ad2, [Ljava.lang.String;@1754ad2, [Ljava.lang.String;@1833955, [Ljava.lang.String;@1833955, [Ljava.lang.String;@1833955, [Ljava.lang.String;@1833955, [Ljava.lang.String;@1833955, [Ljava.lang.String;@291aff, [Ljava.lang.String;@291aff, [Ljava.lang.String;@291aff, [Ljava.lang.String;@291aff, [Ljava.lang.String;@291aff, [Ljava.lang.String;@ab95e6, [Ljava.lang.String;@ab95e6, [Ljava.lang.String;@ab95e6, [Ljava.lang.String;@ab95e6, [Ljava.lang.String;@ab95e6, [Ljava.lang.String;@fe64b9, [Ljava.lang.String;@fe64b9, [Ljava.lang.String;@fe64b9, [Ljava.lang.String;@fe64b9, [Ljava.lang.String;@fe64b9, [Ljava.lang.String;@186db54, [Ljava.lang.String;@186db54, [Ljava.lang.String;@186db54, [Ljava.lang.String;@186db54, [Ljava.lang.String;@186db54, [Ljava.lang.String;@a97b0b, [Ljava.lang.String;@a97b0b, [Ljava.lang.String;@a97b0b, [Ljava.lang.String;@a97b0b, [Ljava.lang.String;@a97b0b, [Ljava.lang.String;@cd2c3c, [Ljava.lang.String;@cd2c3c, [Ljava.lang.String;@cd2c3c, [Ljava.lang.String;@cd2c3c, [Ljava.lang.String;@cd2c3c, [Ljava.lang.String;@13582d, [Ljava.lang.String;@13582d, [Ljava.lang.String;@13582d, [Ljava.lang.String;@13582d, [Ljava.lang.String;@13582d, [Ljava.lang.String;@21b6d, [Ljava.lang.String;@21b6d, [Ljava.lang.String;@21b6d, [Ljava.lang.String;@21b6d, [Ljava.lang.String;@21b6d, [Ljava.lang.String;@56a499, [Ljava.lang.String;@56a499, [Ljava.lang.String;@56a499, [Ljava.lang.String;@56a499, [Ljava.lang.String;@56a499, [Ljava.lang.String;@506411, [Ljava.lang.String;@506411, [Ljava.lang.String;@506411, [Ljava.lang.String;@506411, [Ljava.lang.String;@506411, [Ljava.lang.String;@1d99a4d, [Ljava.lang.String;@1d99a4d, [Ljava.lang.String;@1d99a4d, [Ljava.lang.String;@1d99a4d, [Ljava.lang.String;@1d99a4d, [Ljava.lang.String;@12152e6, [Ljava.lang.String;@12152e6, [Ljava.lang.String;@12152e6, [Ljava.lang.String;@12152e6, [Ljava.lang.String;@12152e6]

    Do I need to convert the ArrayList to a standard Array before I can read the data? O_o

    EDIT:

    Ok, I converted the ArrayList to an Array...but I still get the same odd values in my array O_o
    0        [Ljava.lang.String;@1034bb5
    1        [Ljava.lang.String;@1034bb5
    2        [Ljava.lang.String;@1034bb5
    3        [Ljava.lang.String;@1034bb5
    4        [Ljava.lang.String;@1034bb5
    5        [Ljava.lang.String;@15f5897
    6        [Ljava.lang.String;@15f5897
    7        [Ljava.lang.String;@15f5897
    8        [Ljava.lang.String;@15f5897
    9        [Ljava.lang.String;@15f5897
    10        [Ljava.lang.String;@b162d5
    11        [Ljava.lang.String;@b162d5
    12        [Ljava.lang.String;@b162d5
    13        [Ljava.lang.String;@b162d5
    14        [Ljava.lang.String;@b162d5
    15        [Ljava.lang.String;@1cfb549
    16        [Ljava.lang.String;@1cfb549
    17        [Ljava.lang.String;@1cfb549
    18        [Ljava.lang.String;@1cfb549
    19        [Ljava.lang.String;@1cfb549
    20        [Ljava.lang.String;@186d4c1
    21        [Ljava.lang.String;@186d4c1
    22        [Ljava.lang.String;@186d4c1
    23        [Ljava.lang.String;@186d4c1
    24        [Ljava.lang.String;@186d4c1
    25        [Ljava.lang.String;@f9f9d8
    26        [Ljava.lang.String;@f9f9d8
    27        [Ljava.lang.String;@f9f9d8
    28        [Ljava.lang.String;@f9f9d8
    29        [Ljava.lang.String;@f9f9d8
    30        [Ljava.lang.String;@1820dda
    31        [Ljava.lang.String;@1820dda
    32        [Ljava.lang.String;@1820dda
    33        [Ljava.lang.String;@1820dda
    34        [Ljava.lang.String;@1820dda
    35        [Ljava.lang.String;@15b7986
    36        [Ljava.lang.String;@15b7986
    37        [Ljava.lang.String;@15b7986
    38        [Ljava.lang.String;@15b7986
    39        [Ljava.lang.String;@15b7986
    40        [Ljava.lang.String;@87816d
    41        [Ljava.lang.String;@87816d
    42        [Ljava.lang.String;@87816d
    43        [Ljava.lang.String;@87816d
    44        [Ljava.lang.String;@87816d
    45        [Ljava.lang.String;@1d9dc39
    46        [Ljava.lang.String;@1d9dc39
    47        [Ljava.lang.String;@1d9dc39
    48        [Ljava.lang.String;@1d9dc39
    49        [Ljava.lang.String;@1d9dc39
    50        [Ljava.lang.String;@93dcd
    51        [Ljava.lang.String;@93dcd
    52        [Ljava.lang.String;@93dcd
    53        [Ljava.lang.String;@93dcd
    54        [Ljava.lang.String;@93dcd
    55        [Ljava.lang.String;@b89838
    56        [Ljava.lang.String;@b89838
    57        [Ljava.lang.String;@b89838
    58        [Ljava.lang.String;@b89838
    59        [Ljava.lang.String;@b89838
    60        [Ljava.lang.String;@111a3ac
    61        [Ljava.lang.String;@111a3ac
    62        [Ljava.lang.String;@111a3ac
    63        [Ljava.lang.String;@111a3ac
    64        [Ljava.lang.String;@111a3ac
    65        [Ljava.lang.String;@110b053
    66        [Ljava.lang.String;@110b053
    67        [Ljava.lang.String;@110b053
    68        [Ljava.lang.String;@110b053
    69        [Ljava.lang.String;@110b053
    70        [Ljava.lang.String;@a83b8a
    71        [Ljava.lang.String;@a83b8a
    72        [Ljava.lang.String;@a83b8a
    73        [Ljava.lang.String;@a83b8a
    74        [Ljava.lang.String;@a83b8a
    75        [Ljava.lang.String;@dd20f6
    76        [Ljava.lang.String;@dd20f6
    77        [Ljava.lang.String;@dd20f6
    78        [Ljava.lang.String;@dd20f6
    79        [Ljava.lang.String;@dd20f6
    80        [Ljava.lang.String;@19efb05
    81        [Ljava.lang.String;@19efb05
    82        [Ljava.lang.String;@19efb05
    83        [Ljava.lang.String;@19efb05
    84        [Ljava.lang.String;@19efb05
    85        [Ljava.lang.String;@723d7c
    86        [Ljava.lang.String;@723d7c
    87        [Ljava.lang.String;@723d7c
    88        [Ljava.lang.String;@723d7c
    89        [Ljava.lang.String;@723d7c
    90        [Ljava.lang.String;@22c95b
    91        [Ljava.lang.String;@22c95b
    92        [Ljava.lang.String;@22c95b
    93        [Ljava.lang.String;@22c95b
    94        [Ljava.lang.String;@22c95b
    95        [Ljava.lang.String;@1d1acd3
    96        [Ljava.lang.String;@1d1acd3
    97        [Ljava.lang.String;@1d1acd3
    98        [Ljava.lang.String;@1d1acd3
    99        [Ljava.lang.String;@1d1acd3
    100        [Ljava.lang.String;@a981ca
    101        [Ljava.lang.String;@a981ca
    102        [Ljava.lang.String;@a981ca
    103        [Ljava.lang.String;@a981ca
    104        [Ljava.lang.String;@a981ca
    105        [Ljava.lang.String;@8814e9
    106        [Ljava.lang.String;@8814e9
    107        [Ljava.lang.String;@8814e9
    108        [Ljava.lang.String;@8814e9
    109        [Ljava.lang.String;@8814e9
    110        [Ljava.lang.String;@1503a3
    111        [Ljava.lang.String;@1503a3
    112        [Ljava.lang.String;@1503a3
    113        [Ljava.lang.String;@1503a3
    114        [Ljava.lang.String;@1503a3
    115        [Ljava.lang.String;@1a1c887
    116        [Ljava.lang.String;@1a1c887
    117        [Ljava.lang.String;@1a1c887
    118        [Ljava.lang.String;@1a1c887
    119        [Ljava.lang.String;@1a1c887
    120        [Ljava.lang.String;@743399
    121        [Ljava.lang.String;@743399
    122        [Ljava.lang.String;@743399
    123        [Ljava.lang.String;@743399
    124        [Ljava.lang.String;@743399
    125        [Ljava.lang.String;@e7b241
    126        [Ljava.lang.String;@e7b241
    127        [Ljava.lang.String;@e7b241
    128        [Ljava.lang.String;@e7b241
    129        [Ljava.lang.String;@e7b241
    130        [Ljava.lang.String;@167d940
    131        [Ljava.lang.String;@167d940
    132        [Ljava.lang.String;@167d940
    133        [Ljava.lang.String;@167d940
    134        [Ljava.lang.String;@167d940
    135        [Ljava.lang.String;@e83912
    136        [Ljava.lang.String;@e83912
    137        [Ljava.lang.String;@e83912
    138        [Ljava.lang.String;@e83912
    139        [Ljava.lang.String;@e83912
    140        [Ljava.lang.String;@1fae3c6
    141        [Ljava.lang.String;@1fae3c6
    142        [Ljava.lang.String;@1fae3c6
    143        [Ljava.lang.String;@1fae3c6
    144        [Ljava.lang.String;@1fae3c6
    145        [Ljava.lang.String;@7ffe01
    146        [Ljava.lang.String;@7ffe01
    147        [Ljava.lang.String;@7ffe01
    148        [Ljava.lang.String;@7ffe01
    149        [Ljava.lang.String;@7ffe01
    150        [Ljava.lang.String;@fd13b5
    151        [Ljava.lang.String;@fd13b5
    152        [Ljava.lang.String;@fd13b5
    153        [Ljava.lang.String;@fd13b5
    154        [Ljava.lang.String;@fd13b5
    155        [Ljava.lang.String;@118f375
    156        [Ljava.lang.String;@118f375
    157        [Ljava.lang.String;@118f375
    158        [Ljava.lang.String;@118f375
    159        [Ljava.lang.String;@118f375
    160        [Ljava.lang.String;@117a8bd
    161        [Ljava.lang.String;@117a8bd
    162        [Ljava.lang.String;@117a8bd
    163        [Ljava.lang.String;@117a8bd
    164        [Ljava.lang.String;@117a8bd
    165        [Ljava.lang.String;@471e30
    166        [Ljava.lang.String;@471e30
    167        [Ljava.lang.String;@471e30
    168        [Ljava.lang.String;@471e30
    169        [Ljava.lang.String;@471e30
    170        [Ljava.lang.String;@10ef90c
    171        [Ljava.lang.String;@10ef90c
    172        [Ljava.lang.String;@10ef90c
    173        [Ljava.lang.String;@10ef90c
    174        [Ljava.lang.String;@10ef90c
    175        [Ljava.lang.String;@a32b
    176        [Ljava.lang.String;@a32b
    177        [Ljava.lang.String;@a32b
    178        [Ljava.lang.String;@a32b
    179        [Ljava.lang.String;@a32b
    180        [Ljava.lang.String;@1d8957f
    181        [Ljava.lang.String;@1d8957f
    182        [Ljava.lang.String;@1d8957f
    183        [Ljava.lang.String;@1d8957f
    184        [Ljava.lang.String;@1d8957f
    185        [Ljava.lang.String;@3ee284
    186        [Ljava.lang.String;@3ee284
    187        [Ljava.lang.String;@3ee284
    188        [Ljava.lang.String;@3ee284
    189        [Ljava.lang.String;@3ee284
    190        [Ljava.lang.String;@8965fb
    191        [Ljava.lang.String;@8965fb
    192        [Ljava.lang.String;@8965fb
    193        [Ljava.lang.String;@8965fb
    194        [Ljava.lang.String;@8965fb
    195        [Ljava.lang.String;@867e89
    196        [Ljava.lang.String;@867e89
    197        [Ljava.lang.String;@867e89
    198        [Ljava.lang.String;@867e89
    199        [Ljava.lang.String;@867e89
    200        [Ljava.lang.String;@1dd7056
    201        [Ljava.lang.String;@1dd7056
    202        [Ljava.lang.String;@1dd7056
    203        [Ljava.lang.String;@1dd7056
    204        [Ljava.lang.String;@1dd7056
    205        [Ljava.lang.String;@fa3ac1
    206        [Ljava.lang.String;@fa3ac1
    207        [Ljava.lang.String;@fa3ac1
    208        [Ljava.lang.String;@fa3ac1
    209        [Ljava.lang.String;@fa3ac1
    210        [Ljava.lang.String;@276af2
    211        [Ljava.lang.String;@276af2
    212        [Ljava.lang.String;@276af2
    213        [Ljava.lang.String;@276af2
    214        [Ljava.lang.String;@276af2
    215        [Ljava.lang.String;@1de3f2d
    216        [Ljava.lang.String;@1de3f2d
    217        [Ljava.lang.String;@1de3f2d
    218        [Ljava.lang.String;@1de3f2d
    219        [Ljava.lang.String;@1de3f2d
    220        [Ljava.lang.String;@5d173
    221        [Ljava.lang.String;@5d173
    222        [Ljava.lang.String;@5d173
    223        [Ljava.lang.String;@5d173
    224        [Ljava.lang.String;@5d173
    225        [Ljava.lang.String;@1f9dc36
    226        [Ljava.lang.String;@1f9dc36
    227        [Ljava.lang.String;@1f9dc36
    228        [Ljava.lang.String;@1f9dc36
    229        [Ljava.lang.String;@1f9dc36
    230        [Ljava.lang.String;@e86da0
    231        [Ljava.lang.String;@e86da0
    232        [Ljava.lang.String;@e86da0
    233        [Ljava.lang.String;@e86da0
    234        [Ljava.lang.String;@e86da0
    235        [Ljava.lang.String;@1833955
    236        [Ljava.lang.String;@1833955
    237        [Ljava.lang.String;@1833955
    238        [Ljava.lang.String;@1833955
    239        [Ljava.lang.String;@1833955
    240        [Ljava.lang.String;@291aff
    241        [Ljava.lang.String;@291aff
    242        [Ljava.lang.String;@291aff
    243        [Ljava.lang.String;@291aff
    244        [Ljava.lang.String;@291aff
    245        [Ljava.lang.String;@ab95e6
    246        [Ljava.lang.String;@ab95e6
    247        [Ljava.lang.String;@ab95e6
    248        [Ljava.lang.String;@ab95e6
    249        [Ljava.lang.String;@ab95e6
    250        [Ljava.lang.String;@fe64b9
    251        [Ljava.lang.String;@fe64b9
    252        [Ljava.lang.String;@fe64b9
    253        [Ljava.lang.String;@fe64b9
    254        [Ljava.lang.String;@fe64b9
    255        [Ljava.lang.String;@186db54
    256        [Ljava.lang.String;@186db54
    257        [Ljava.lang.String;@186db54
    258        [Ljava.lang.String;@186db54
    259        [Ljava.lang.String;@186db54
    260        [Ljava.lang.String;@a97b0b
    261        [Ljava.lang.String;@a97b0b
    262        [Ljava.lang.String;@a97b0b
    263        [Ljava.lang.String;@a97b0b
    264        [Ljava.lang.String;@a97b0b
    265        [Ljava.lang.String;@cd2c3c
    266        [Ljava.lang.String;@cd2c3c
    267        [Ljava.lang.String;@cd2c3c
    268        [Ljava.lang.String;@cd2c3c
    269        [Ljava.lang.String;@cd2c3c
    270        [Ljava.lang.String;@13582d
    271        [Ljava.lang.String;@13582d
    272        [Ljava.lang.String;@13582d
    273        [Ljava.lang.String;@13582d
    274        [Ljava.lang.String;@13582d
    275        [Ljava.lang.String;@21b6d
    276        [Ljava.lang.String;@21b6d
    277        [Ljava.lang.String;@21b6d
    278        [Ljava.lang.String;@21b6d
    279        [Ljava.lang.String;@21b6d
    280        [Ljava.lang.String;@56a499
    281        [Ljava.lang.String;@56a499
    282        [Ljava.lang.String;@56a499
    283        [Ljava.lang.String;@56a499
    284        [Ljava.lang.String;@56a499
    285        [Ljava.lang.String;@506411
    286        [Ljava.lang.String;@506411
    287        [Ljava.lang.String;@506411
    288        [Ljava.lang.String;@506411
    289        [Ljava.lang.String;@506411
    290        [Ljava.lang.String;@1d99a4d
    291        [Ljava.lang.String;@1d99a4d
    292        [Ljava.lang.String;@1d99a4d
    293        [Ljava.lang.String;@1d99a4d
    294        [Ljava.lang.String;@1d99a4d
    295        [Ljava.lang.String;@12152e6
    296        [Ljava.lang.String;@12152e6
    297        [Ljava.lang.String;@12152e6
    298        [Ljava.lang.String;@12152e6
    299        [Ljava.lang.String;@12152e6
    300        [Ljava.lang.String;@c9ba38
    301        [Ljava.lang.String;@c9ba38
    302        [Ljava.lang.String;@c9ba38
    303        [Ljava.lang.String;@c9ba38
    304        [Ljava.lang.String;@c9ba38
    305        [Ljava.lang.String;@1e0be38
    306        [Ljava.lang.String;@1e0be38
    307        [Ljava.lang.String;@1e0be38
    308        [Ljava.lang.String;@1e0be38
    309        [Ljava.lang.String;@1e0be38
    310        [Ljava.lang.String;@1e859c0
    311        [Ljava.lang.String;@1e859c0
    312        [Ljava.lang.String;@1e859c0
    313        [Ljava.lang.String;@1e859c0
    314        [Ljava.lang.String;@1e859c0

        private static void readLine (String[] args) throws FileNotFoundException{
           //it reads the lines and then splits them in seperate lines
            try {
                FileInputStream inStream = new FileInputStream(fileName);
                DataInputStream in = new DataInputStream(inStream);
                BufferedReader br = new BufferedReader(new InputStreamReader(in));
                String line;
     
                boolean firstHeat = true;
                while ((line = br.readLine()) != null) {
                    if (!line.equals("")) {
                        if (line.trim().startsWith("Heat")) {
                            if (firstHeat) {
                                firstHeat = false;
                            } else {
                                //add old heat to the heat array
                            }
                            //create a new heat object
                        } else {
     
                            //create new athlete object and add it to the heat
                            athlete = line.trim().split("\\b\\s{2,}\\b");
                            for (int i = 0; i < athlete.length; i++) {
                            //for (int i = 0; i < athlete.length; i++) {
                                //System.out.println(athlete[i]);
                                heatsL.add(athlete);
                            }
                           }
                    }
                }
                in.close();
                } catch (Exception e) {
                System.err.println("Error: " + e.getMessage());
            }
              Object HeatsArray[] = heatsL.toArray();
     
              int sum = 0;
            System.out.println("Contents of Athlete Array");
            for (int counter = 0; counter < HeatsArray.length; counter++) {
                System.out.println(counter + "\t" + HeatsArray[counter]);
     
     
            }
     
    }

    Can someone put me out of my misery with this lol!
    Last edited by K0209; January 10th, 2010 at 07:46 AM.

  19. #44
    Junior Member
    Join Date
    Dec 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    This is my newest Code...

    I have methods at the bottom to sort and print the Winners (ArrayList)...I don;t know if they work because I still can't get them to store.

    package coursework1;
     
    import java.lang.*;
    import java.util.*;
    import java.io.*;
    //import java.util.ArrayList;
    //import java.util.List;
     
    public class Main {
        //Golbal variables to be accessed by most of my methods
        static String fileName = "";//The file that the user wants to access
        static String [] athlete; //Used to store each lines info
        static List heatsL = new ArrayList();//This will hold each Athlete Array
     
        public static void main (String[] args) throws FileNotFoundException{
        Main.body(args);
               }
     
        private static void body (String[] args) throws FileNotFoundException{
        //the bulk of the code/calling will go here, so that main is left with
        //as few calls as possible for ease.
            Main.getFileName(args);
            Main.readLine(args);
            //Main.showAthleteArray(args);
                               }
     
        private static void getFileName (String[] args)throws FileNotFoundException{
            InputStreamReader input = new InputStreamReader(System.in);
            BufferedReader reader = new BufferedReader(input);
            System.out.println("Please type your file name (including the Extension): ");
            // read in user input
            try {
                fileName = reader.readLine();
                }
            catch(Exception e){}
            System.out.println("\n====CONFIRMATION====\nFile Name: " + fileName + "\n==END CONFIRMATION==\n\n");
                }
     
        private static void printFile (String[]args) throws FileNotFoundException{
             //This will Print the file in its entirety.
             try {
                BufferedReader br = new BufferedReader(new FileReader(fileName));
                String strLine;
                while ((strLine = br.readLine()) != null) {
                    System.out.println(strLine);
                }
                br.close();
            } catch (Exception exc) {
                System.err.println("Error: " + exc.getMessage());
            }
        }
     
        private static void readLine (String[] args) throws FileNotFoundException{
           //it reads the lines and then splits them in seperate lines
            try {
                FileInputStream inStream = new FileInputStream(fileName);
                DataInputStream in = new DataInputStream(inStream);
                BufferedReader br = new BufferedReader(new InputStreamReader(in));
                String line;
     
                // create an array of heats for size 7
                // Heat[] heats = new Heat[7];
                boolean firstHeat = true;
                while ((line = br.readLine()) != null) {
                    if (!line.equals("")) {
                        if (line.trim().startsWith("Heat")) {
                            if (firstHeat) {
                                firstHeat = false;
                            } else {
                                //add old heat to the heat array
                            }
                            //create a new heat object
                        } else {
     
                            //create new athlete object and add it to the heat
                            athlete = line.trim().split("\\b\\s{2,}\\b");
                            for (int i = 0; i < athlete.length; i++) {
                            //for (int i = 0; i < athlete.length; i++) {
                                //System.out.println(athlete[i]);
                                heatsL.add(athlete);
                            }
                           }
                    }
                }
                in.close();
                } catch (Exception e) {
                System.err.println("Error: " + e.getMessage());
            }
              Object HeatsArray[] = heatsL.toArray();
     
              int sum = 0;
            System.out.println("Contents of Athlete Array");
            for (int counter = 0; counter < HeatsArray.length; counter++) {
                System.out.println(counter + "\t" + HeatsArray[counter]);
            }
     
    }
         private static void sortArryList (String[] args){
           Collections.sort(heatsL);  
             }
     
         private static void printWinners (String[]args){
             for (int i =0; i < 21; i++ ){
                 heatsL.get(i);
              }
         }
     
    }

  20. #45
    Junior Member
    Join Date
    Jan 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Problems with File Reader (Strings and 2D Array Storage)

    How did your final prduct go K0209?

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Buffered Reader is not reading my file properly... HELP!
    By mannyT in forum File I/O & Other I/O Streams
    Replies: 8
    Last Post: November 8th, 2009, 07:14 PM
  2. Strings
    By Leeds_Champion in forum Algorithms & Recursion
    Replies: 3
    Last Post: November 3rd, 2009, 09:09 PM
  3. greetings and a file reader problem
    By chileshe in forum File I/O & Other I/O Streams
    Replies: 0
    Last Post: October 6th, 2009, 03:45 AM
  4. Returning Random Strings from an Array
    By cfmonster in forum Collections and Generics
    Replies: 3
    Last Post: September 8th, 2009, 11:13 PM
  5. Code to read a character in the file
    By Truffy in forum File I/O & Other I/O Streams
    Replies: 4
    Last Post: May 19th, 2009, 06:11 PM