justinput

Simple state machine.

License

License

GroupId

GroupId

com.nofacepress
ArtifactId

ArtifactId

justinput
Last Version

Last Version

0.5.0
Release Date

Release Date

Type

Type

jar
Description

Description

justinput
Simple state machine.
Project URL

Project URL

https://github.com/nofacepress/csv4180
Project Organization

Project Organization

No Face Press, LLC
Source Code Management

Source Code Management

https://github.com/nofacepress/csv4180

Download justinput

How to add to project

<!-- https://jarcasting.com/artifacts/com.nofacepress/justinput/ -->
<dependency>
    <groupId>com.nofacepress</groupId>
    <artifactId>justinput</artifactId>
    <version>0.5.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.nofacepress/justinput/
implementation 'com.nofacepress:justinput:0.5.0'
// https://jarcasting.com/artifacts/com.nofacepress/justinput/
implementation ("com.nofacepress:justinput:0.5.0")
'com.nofacepress:justinput:jar:0.5.0'
<dependency org="com.nofacepress" name="justinput" rev="0.5.0">
  <artifact name="justinput" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.nofacepress', module='justinput', version='0.5.0')
)
libraryDependencies += "com.nofacepress" % "justinput" % "0.5.0"
[com.nofacepress/justinput "0.5.0"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

CSV4180 - CSV parser based on RFC 4180

Java implementation of a comma separated values, CSV, reader and writer based on RFC 4180. This format is exactly as Excel handles CSV files. CSV4180 is simple to use and understand with a commercial friendly license.

CSV4180 is a Java implementation of a comma separated values (CSV) reader and writer based on RFC 4180. This format is exactly as Excel handles CSV files. CSV4180 is simple to use and understand with a commercial friendly license.

This library is all business with no frills. There are tons of powerful alternatives to this implementation with tons of configuration options, but beware that many do not actually support the format used by Excel even though they may say it does. The main objective of CSV4180 is Excel compatibility, so there is no configuration required. And best of all, it is Apache 2.0 licensed making it truly free, unlike GPL.

This library was created because other libraries had bad licenses, invalid implementations or were unnecessarily complicated. If someone is interested in CSV then they are most likely interested in Excel. "Make it simple stupid" is the motto for CSV4180. CSV is not hard, so there is no need to go overboard when implementing it.

Build status:build_status

Maven Setup

<dependency>
  <groupId>com.nofacepress</groupId>
  <artifactId>csv-4180</artifactId>
  <version>0.2.7</version>
</dependency>

Quick Start: Reading Files

The most intuitive way to to read the CSV file one row at a time. This is done using the convenience method CSVReader::readFields() as shown below.

CSVReader csvReader = new CSVReader(new FileReader(fileName));
ArrayList<String> fields = new ArrayList<String>();
while (!csvReader.isEOF()) {
	csvReader.readFields(fields);
	// ... process row 
}

However, the most direct method reads a field at a time eliminating the need for an ArrayList.

CSVReader csvReader = new CSVReader(new FileReader(fileName));
while (!csvReader.isEOF()) {
	do {
		String field = csvReader.readField();
		// ... process field 
	} while (csvReader.hasMoreFieldsOnLine());
	// ... process row 
}

Quick Start: Writing Files

The most intuitive way is to write the CSV file one row at a time. This is done using the convenience method CSVReader::writeFields() as shown below. This method accepts ArrayList or String[] arguments.

CSVReader csvWriter = new CSVWriter(new FileReader(fileName));
ArrayList<String> fields = new ArrayList<String>();
// ...  
csvWriter.writeFields(fields);
// ...  
csvWriter.close();

However, the most direct method is to write a field at a time calling CSVWriter::newLine() when a row is complete.

CSVReader csvWriter = new CSVWriter(new FileReader(fileName));
String field;
// ...  
csvWriter.writeField(field);
// write more fields  
csvWriter.newLine();
// ...  
csvWriter.writeField(field);
// write more fields  
csvWriter.close();
com.nofacepress

noface.press LLC

Versions

Version
0.5.0
0.4.0
0.3.0
0.2.0
0.1.0