<dependency> <groupId>com.univocity</groupId> <artifactId>univocity-parsers</artifactId> <version>2.9.1</version> </dependency> import com.univocity.parsers.csv.CsvParser; import com.univocity.parsers.csv.CsvParserSettings; CsvParserSettings settings = new CsvParserSettings(); settings.getFormat().setLineSeparator(" CsvParser parser = new CsvParser(settings); List<String[]> allRows = parser.parseAll(new FileReader("data.csv")); for (String[] row : allRows) { for (String value : row) { System.out.print(value + " "); } System.out.println(); } parser.stopParsing();


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