title: Reading, parsing and sorting data from a CSV file
body: <p>I need to read in a csv file, parse it and then sort the value according to these parameter:</p>
  
  <ol>
  <li>The top 10 selling products</li>
  <li>The top performing branches</li>
  <li>The worst performing branches</li>
  <li>The employee who took the most sales</li>
  </ol>
  
  <p>Here is my code so far, any advice on how to sort it?</p>
  
  <pre><code>import java.io.*;
  
  public class CSV {
  public static void main(String[] args) throws IOException {
      try (BufferedReader CSVFile = new BufferedReader(new FileReader("/K:/ConnexicaWork/data/data.csv"))) {
          String[] dataArray = null;
          String data = CSVFile.readLine(); // Read first line.
  
          while (data != null) {
              data = data.replace(",00", ".00");
              dataArray = data.split(",(?=([^\"]*\"[^\"]*\")*[^\"]*$)"); //split on the comma only if that comma has zero, or an even number of quotes in ahead of it.
              for (String item : dataArray) {
                  System.out.print(dataArray[34] + " # ");
              }
              System.out.println(); // Print the data line.
              data = CSVFile.readLine(); // Read next line of data.
          }
      }
  
  
      System.out.println();  // End the printout with a blank line.
  
  }
  }
  </code></pre>