CSV API

Java CSV reader/writer API. API support multiline fields, and custom separators.

License

License

Categories

Categories

CSV Data Data Formats
GroupId

GroupId

io.github.etuzon
ArtifactId

ArtifactId

java.csv.api
Last Version

Last Version

1.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

CSV API
Java CSV reader/writer API. API support multiline fields, and custom separators.
Project URL

Project URL

https://github.com/etuzon/Java-CSV-API
Source Code Management

Source Code Management

https://github.com/etuzon/Java-CSV-API

Download java.csv.api

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.etuzon/java.csv.api/ -->
<dependency>
    <groupId>io.github.etuzon</groupId>
    <artifactId>java.csv.api</artifactId>
    <version>1.0.5</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.etuzon/java.csv.api/
implementation 'io.github.etuzon:java.csv.api:1.0.5'
// https://jarcasting.com/artifacts/io.github.etuzon/java.csv.api/
implementation ("io.github.etuzon:java.csv.api:1.0.5")
'io.github.etuzon:java.csv.api:jar:1.0.5'
<dependency org="io.github.etuzon" name="java.csv.api" rev="1.0.5">
  <artifact name="java.csv.api" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.etuzon', module='java.csv.api', version='1.0.5')
)
libraryDependencies += "io.github.etuzon" % "java.csv.api" % "1.0.5"
[io.github.etuzon/java.csv.api "1.0.5"]

Dependencies

compile (1)

Group / Artifact Type Version
io.github.etuzon : java.projects.core jar 1.0.12

test (2)

Group / Artifact Type Version
org.testng : testng jar 6.9.8
io.github.etuzon : java.tests.core jar 1.0.8

Project Modules

There are no modules declared in this project.

Java-CSV-API

Java CSV Reader/writer API.

API support multiline fields, and custom separators.

Example of multiline CSV:

header1,"header
2",header3
field1,field2,"field
3"


Code Example:

//Read CSV file
CsvReaderApi csvReader = new CsvReaderApi(CSV_PATH);

List<String> headerList = csvReader.getHeaderList();
List<List<String>> rowsList = csvReader.getRows();

//Overwrite CSV file
CsvWriterApi csvWriter = new CsvWriterApi(CSV_PATH);
csvWriter.setHeaders(headerList);
csvWriter.addRows(rowsList);
//Add new Row that one of the fields is multiline field
//ListUtil.asList is method in Java-Projects-Core
List<String> row = ListUtil.asList("1", "2\n123", "3");
csvWriter.addRow(row);
//save to file
csvWriter.save();

Versions

Version
1.0.5