CSV Parser

@aljunggren aljunggren authored on 12 May 2021
src Initial commit 5 years ago
.gitignore Initial commit 5 years ago
README.md Initial commit 5 years ago
lombok.config Initial commit 5 years ago
pom.xml Initial commit 5 years ago
README.md

CSV-Parser

Parse CSV and map to a given class.

Parser parser = new Parser();
List<MyClass> results = parser.parse(file, MyClass.class);

Annotate private member variables with @CSVColumn. Set value equal to the name of the column as viewed in Excel

@CSVColumn(value = "A")

Defining class map

public class MyClass {
    @CSVColumn(value = "A")
    private String firstName;
    
    @CSVColumn(value = "B")
    private String lastName;
    
    @CSVColumn(value = "G")
    private int age;
    
    // Getters & Setters
}