public static void main(String[] fileLocation){
//        String file = "/Users/ashishsri/Downloads/20140831.csv";
        String file = fileLocation[0];
        File fileObj = new File(file);
        MyCSVReader csvReader = new MyCSVReader(file);
        List<Diamond> diamonds = csvReader.serializeDiamonds();
        csvReader.close();
        Table<String,String,Table<String,String,Diamond>> sizingTable = HashBasedTable.create();
        String fileOut = fileObj.getParent()+"/"+fileObj.getName().replace(".csv","_fileout.csv");
        System.out.println("Writing in file"+fileOut);
        MyCSVWriter csvWriter = new MyCSVWriter(fileOut);
        HashMap<String,List<Diamond>> sizeFromMap = groupDiamondsByField(diamonds,"SizeFrom");
        for(Map.Entry<String, List<Diamond>> sizeFromEntry : sizeFromMap.entrySet()){
            String sizeFrom = sizeFromEntry.getKey();
            HashMap<String,List<Diamond>> sizeToMap = groupDiamondsByField(sizeFromEntry.getValue(),"SizeTo");
            for(Map.Entry<String,List<Diamond>> sizeToEntry:sizeToMap.entrySet()){
                String sizeTo = sizeToEntry.getKey();
                Table<String,String,Diamond> colorClarityTable = HashBasedTable.create();
                for(Diamond d:sizeToEntry.getValue()){
                    colorClarityTable.put(d.getColor(),d.getClarity(),d);
                }
                sizingTable.put(sizeFrom,sizeTo,colorClarityTable);
            }
        }
        for(String sizeFrom:sizingTable.rowKeySet()){
            for(String sizeTo:sizingTable.columnKeySet()){
                Table<String,String,Diamond> diamondsForThisSize = sizingTable.row(sizeFrom).get(sizeTo);
                if(diamondsForThisSize!=null){
                    System.out.println(sizeFrom+"-"+sizeTo);
                    csvWriter.writeLn(sizeFrom+"-"+sizeTo);
                    writeTable(csvWriter,diamondsForThisSize);
                }
            }
        }
        csvWriter.flush();
        csvWriter.close();
    }