title: read txt file and add each column to different array in java
body: <p>My txt file is look like : </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>1,2,6,8,10,3
  0,3,5,0
  0,1
  1,6,90,6,7</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am reading txt file . but I want to create array for each column. 
  <a href="https://i.stack.imgur.com/LoRVv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LoRVv.png" alt="enter image description here"></a></p>
  
  <p>for example : </p>
  
  <p>array0 will contain : 1,2,6,8,10,3</p>
  
  <p>array1 will contain : 0,3,5,0</p>
  
  <p>how I can do that? </p>
  
  <p>my code : </p>
  
  <pre><code>File file = new File("src/maze.txt");
   try (FileInputStream fis = new FileInputStream(file)) {
          // Read the maze from the input file
  
          ArrayList column1array = new ArrayList (); 
          ArrayList column2array = new ArrayList (); 
          while ((content = fis.read()) != -1) {
              char c = (char) content;
  
              column1array.add(c);
  
          }
       }
  </code></pre>