Java - Store data from file into Arrays -


I also got my program to read the file and show file information but I have to know how to store the data The file is in two dimensional array and one dimensional array.

The file that is reads looks like this: 1000, Adams, Olive, 80,78,61,91,20,18,18, 20,19,20,19,20 , 20,19,20, bus, 3.11 1001, Smith, Kimberley, 70,68,53,72,20,20,18,20,18,18,20,19,20, 19.18, IMD, 3.5 1002, Fendez, Aaron, 76,67,72,99,18,20,20,19,19,19,19,19,19,19,20, Bio, 2.7

Two-dimensional array All numbers must be kept between names and three letters.

One dimensional array must be kept in the GPA at the end.

My question happens once again: How do I get the file to store files in the array?

  import java.io. *; Public class students {public static zero chief (string [] args) {int [] [] studentskocus = new int [9 3] [15]; Float [] student GPA = new float [9 3]; String filename = "student @ txt"; {FileReader fileReader = try New FileReader (fileName); Buffer Redder Buffered Reader = New Buffettder (File Reader); String line; While ((line = buffed reader.readline ())! = Null) System.out.println (line); } Hold (IOException pre) {System.out.println ("error"); }}}}    

If you are sure that your input will always be from a file The same form (i.e. with the same amount of data per line, and with this sequence):

  public static zero main (string [] args) {int [] [] studentScores = new int [93] [15]; Float [] student GPA = new float [9 3]; String filename = "student @ txt"; {FileReader fileReader = try New FileReader (fileName); Buffer Redder Buffered Reader = New Buffettder (File Reader); String line; int studentIndex = 0; String [] lineSplit; While ((line = bufferedReader.readLine ())! = Null {System.out.println (line); lineple = line.spitit (","); (int k = 0; k    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -