CSVReader reader = new CSVReader(new FileReader("data.csv"), ',', '"', 1); String[] nextLine; while ((nextLine = reader.readNext()) != null) { } reader.close(); CSVParser parser = new CSVParserBuilder().withSeparator('\t').build(); CSVReader reader = new CSVReaderBuilder(new FileReader("data.csv")).withCSVParser(parser).build(); String[] nextLine; while ((nextLine = reader.readNext()) != null) { } reader.close(); CSVReader reader = new CSVReader(new FileReader("data.csv"), ',', '"', 1, 8192); String[] nextLine; while ((nextLine = reader.readNext()) != null) { } reader.close(); ExecutorService executor = Executors.newFixedThreadPool(4); CSVReader reader = new CSVReader(new FileReader("data.csv"), ',', '"', 1); String[] nextLine; while ((nextLine = reader.readNext()) != null) { final String[] line = nextLine; executor.submit(() -> { }); } reader.close(); executor.shutdown();


上一篇:
下一篇:
切换中文