OrangeSignal CSV is a very flexible csv (comma-separated values) read and write library for Java.
The binary distributions includes the following third party software:
jLHA (LHA Library for Java).
- Java 1.6+
OrangeSignal CSV is compiled for Java 1.6
If you are using Maven, simply copy the following dependency into your pom.xml file. The artifact is hosted at Maven Central, and is standalone (no dependencies).
<dependency>
<groupId>com.orangesignal</groupId>
<artifactId>orangesignal-csv</artifactId>
<version>2.2.1</version>
</dependency>
CSV entity class
@CsvEntity(header = true)
public class Customer {
@CsvColumn(name = "name")
public String name;
@CsvColumn(name = "age")
public Integer age;
}
example code
CsvConfig cfg = new CsvConfig(',', '"', '"');
cfg.setNullString("NULL");
cfg.setIgnoreLeadingWhitespaces(true);
cfg.setIgnoreTrailingWhitespaces(true);
cfg.setIgnoreEmptyLines(true);
cfg.setIgnoreLinePatterns(Pattern.compile("^#.*$"));
cfg.setVariableColumns(false);
List<Customer> list = new CsvEntityManager()
.config(cfg)
.load(Customer.class)
.filter(new SimpleBeanFilter().in("name", "Smith", "Johnson").gt("age", 21))
.offset(10)
.limit(1000)
.order(BeanOrder.desc("age"))
.from(reader);
Sorry, it is japanese only for now.
- Licensed under the Apache License, Version 2.0.