java - Reading, parsing and sorting data from a CSV file -


i need read in csv file, parse , sort value according these parameter:

  1. the top 10 selling products
  2. the top performing branches
  3. the worst performing branches
  4. the employee took sales

here code far, advice on how sort it?

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 comma if comma has zero, or number of quotes in ahead of it.             (string item : dataarray) {                 system.out.print(dataarray[34] + " # ");             }             system.out.println(); // print data line.             data = csvfile.readline(); // read next line of data.         }     }       system.out.println();  // end printout blank line.  } } 


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -