Read and write csv files.
CSV File Manager performs operations with csv files simply and easily.
- Add one of the options below to the pom.xml file:
<dependency>
<groupId>io.github.wniemiec-io-java</groupId>
<artifactId>csv-file-manager</artifactId>
<version>LATEST</version>
</dependency>
<dependency>
<groupId>wniemiec.io.java</groupId>
<artifactId>csv-file-manager</artifactId>
<version>LATEST</version>
</dependency>
- Run
$ mvn install
- Use it
[...]
import wniemiec.io.java.CsvFileManager;
[...]
List<String> firstLine = List.of("hello", "world");
List<String> secondLine = List.of("world", "hello");
File directory = new File(".");
CsvFileManager csvFileManager = new CsvFileManager(directory, "example-file.csv");
csvFileManager.writeLine(firstLine);
csvFileManager.writeLine(secondLine);
System.out.println( csvFileManager.readLines() );
[...]
Property | Parameter type | Return type | Description | Default parameter value |
---|---|---|---|---|
readLines | separator: String |
List<List<String>> |
Reads exported CSV file and returns a Map with its content | "," |
writeLine | line: List<String>, separator: String |
void |
Writes a content to a CSV file | - , "," |
writeLines | lines: List<List<String>>, separator: String |
void |
Writes a content to a CSV file | - , "," |
delete | void |
void |
Removes CSV file | - |
exists | void |
boolean |
Checks whether the CSV file exists | - |
Details about each version are documented in the releases section.
See the documentation on how you can contribute to the project here.
Name | Type | Description |
---|---|---|
dist | Directory |
Released versions |
docs | Directory |
Documentation files |
src | Directory |
Source files |