title: extract data column-wise from text file using Java
body: <p>I'm working under Java and want to extract data according to column from a text file.<br>
  "myfile.txt" contents:  </p>
  
  <pre><code>    ID     SALARY RANK  
      065    12000   1
      023    15000   2
      035    25000   3
      076    40000   4
  </code></pre>
  
  <p>I want to extract the data individually according to any Column i.e ID, SALARY, RANK etc<br>
  Basically I want to perform operations on individual data according to columns.</p>
  
  <p>I've listed the data from "myfile.txt" by using while loop and reading line-by-line:  </p>
  
  <pre><code>    while((line = b.readLine()) != null) {
            stringBuff.append(line + "\n");
         }
  </code></pre>
  
  <p>link: <a href="https://stackoverflow.com/questions/9084040/reading-selective-column-data-from-a-text-file-into-a-list-in-java">Reading selective column data from a text file into a list in Java</a>  </p>
  
  <p>Under bove link it is written to use the following:
  String[] columns = line.split(" ");</p>
  
  <p>But how to use it correctly, please any hint or help?</p>