public void createStockArff(String stockName, ArrayList<Integer> years) {

        String result = "";
        int instances = 0;
        result += "@RELATION " + stockName + "\r\n";
        result += "@ATTRIBUTE day NUMERIC " + "\r\n";
        result += "@ATTRIBUTE price NUMERIC " + "\r\n";
        result += "@DATA " + "\r\n";
        for (Integer i : years) {
            try {
                File f = new File("src/datas/" + stockName + "/" + stockName + "_" + i.toString() + ".csv");
                Scanner sc = new Scanner(f);
                String line = "";
                String ld = "";
                while (sc.hasNext()) {
                    line = sc.nextLine();
//                    System.out.println(f);
//                    System.out.println(line);
                    String date = line.split(";")[0];
                    if (!date.equals(ld)) {
                        instances++;
//                        System.out.println(line);
                        String attr = line.split(";")[1].equals("N/A") ? "?" : line.split(";")[1];
                        String toSave = instances + "," + attr + "\r\n";
                        result += toSave;
                        switch (stockName) {
                            case "djia":
                                djiaData[instances - 1] = attr;
                            case "nasdaq":
                                nasdaqData[instances - 1] = attr;
                            case "eurostoxx":
                                eurostoxxData[instances - 1] = attr;
                        }
                    }
                    ld = date;

                }

            } catch (FileNotFoundException ex) {
                System.out.println("Cannot find specified path: " + stockName + " " + i);
            }
        }
        result = "%" + instances + "\r\n" + result;

        try {
            File f = new File("src/datas/" + stockName + "/" + stockName + ".arff");
            f.delete();
            f.createNewFile();
            PrintWriter out = null;
            out = new PrintWriter(new BufferedWriter(new FileWriter("src/datas/" + stockName + "/" + stockName + ".arff", true)));
            out.print(result);
            out.close();
        } catch (IOException ex) {
            Logger.getLogger(Reader.class.getName()).log(Level.SEVERE, null, ex);
        }
    }