title: How to print out a 2d array in a certain way? (Java)
body: <p>So here is an example text file of what I need to store into a 2d array, and print it out in certain ways.</p>
  
  <p>the file contains two numbers followed by text, the numbers represent the number of rows and columns.</p>
  
  <pre><code>    4 4
      SOME
      FILE
      WITH
      TEXT
  </code></pre>
  
  <p>So I already stored them into an appropriate 2d array, I am just not sure how to print it out to fit this pattern:</p>
  
  <pre><code>    THEE
      XTLM
      EIIO
      TWFS
  </code></pre>
  
  <p>so far to print out the 2d array: i have the code:</p>
  
  <pre><code>    for(int i=0;i&lt;row;i++)
      {
           for(int m=0;m&lt;column;m++)
           {
                System.out.print(charArray[i][m])
            }
                System.out.println();
      }
  </code></pre>
  
  <p>I know to flip it vertically, and horizontally, by manipulating the parameters of how it is printed, but how do I manipulate the parameters so that it will print like the above? THanks so much</p>
  
  <p>The text file would look exactly like above, called txt1.txt.... and I am going to use 4 of them. IT looks exactly like the example listed above:</p>
  
  <pre><code>    4 4
  
      Some 
      File 
      With
      Text
  </code></pre>
  
  <p>my goal is to just store them in a 2d array, and manipulate how I print them. I already know how to manipulate it in some ways but just not in the pattern also listed above. THanks guys! :)</p>