title: Txt file to 2D array
body: <p>I am supposed to convert my 2nd line from my .txt file filled with 15 X's and O's and print it out onto a 2D array in java.</p>
  
  <p>Here is my 1D array on my .txt file.</p>
  
  <pre><code>XOXOX
  XOOXX
  XXXOO
  XXOOO
  XXXXO
  OOOOX
  XOOXX
  OOXXO
  OXOXO
  OXXXO
  </code></pre>
  
  <pre><code>public static void main(String[] args) throws FileNotFoundException {
      Scanner in = new Scanner(System.in);
      System.out.print("Enter the input filename ");
      String inputFile = in.next();
      Scanner inFile = new Scanner(new File(inputFile));
      String line=inFile.nextLine();
      line.toUpperCase();
      String array[] = line.split("X");
      System.out.println(array[0]+  " " + array [1]);
      String arrayE1 = array[0];
      String arrayE2 = array[1];
      Integer.parseInt(arrayE1);
      Integer.parseInt(arrayE2);
      String line2 = inFile.next();
      System.out.println(line2);
  
      char [][] MovieTheater = new char [Integer.parseInt(arrayE1)][Integer.parseInt(arrayE2)];
  
      int k = 0;
      for (int i = 0; i &lt; Integer.parseInt(arrayE1); i++) {
          for (int j = 0; i &lt; Integer.parseInt(arrayE2); j++) {
              MovieTheater[i][j] = line2.charAt(k++);
          }
          System.out.println("");
      }
      inFile.close();
  }
  </code></pre>