SkillAgentSearch skills...

Simplecsv

Simple Java CSV reading and writing library using Java annotations

Install / Use

/learn @j256/Simplecsv
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Simple Java CSV Reader / Writer

Maven Central javadoc ChangeLog Documentation CodeCov CircleCI GitHub License

This package provides some Java classes to help with the reading and writing of CSV files using Java annotations.

Enjoy. Gray Watson

Quick Example:

Define your entity with the fields marked with the @CsvColumn annotation, can also mark get/set methods:

public class Account {
	@CsvColumn(columnName = "Name")
	private String name;
	@CsvColumn(columnName = "Account Number")
	private long number;
	...
}

Create a CSV processor for the Account class.

CsvProcessor<Account> csvProcessor = new CsvProcessor<Account>(Account.class);

Write out all of the accounts from a list of them to a CSV file with a header:

File csvFile = new File(CSV_FILE_PATH);
csvProcessor.writeAll(csvFile, accountList, true /* write header */);

This generates the following output:

"Name","Account Number"
"Bill Smith",1
"Foo Bar",2
"Jim Jimston",3

Now read those accounts back in with an optional error handler:

List<Account> readAccounts = csvProcessor.readAll(csvFile, null /* error handler */);

Maven Configuration

Maven packages are published via Maven Central

<dependency>
	<groupId>com.j256.simplecsv</groupId>
	<artifactId>simplecsv</artifactId>
	<version>2.6</version>
</dependency>

ChangeLog Release Notes

See the ChangeLog.txt file.

View on GitHub
GitHub Stars25
CategoryContent
Updated1mo ago
Forks10

Languages

Java

Security Score

95/100

Audited on Feb 4, 2026

No findings