Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.nio.file.Files;
- import java.nio.file.Paths;
- import org.apache.commons.csv.CSVFormat;
- import org.apache.commons.csv.CSVParser;
- import org.apache.commons.csv.CSVRecord;
- public class Main {
- public static void main(String[] args) {
- try {
- for (CSVRecord line: new CSVParser(Files.newBufferedReader(Paths.get("t.csv")), CSVFormat.RFC4180)) {
- int i = 0;
- for (String s: line) {
- System.out.printf("f%d: <%s>\n", i++, s);
- }
- }
- } catch (Exception e) {
- e.printStackTrace(System.err);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement