com.github.gwenn:scanner

Yet another CSV reader/pull parser/stream parser with small memory usage

License

License

GroupId

GroupId

com.github.gwenn
ArtifactId

ArtifactId

scanner
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

com.github.gwenn:scanner
Yet another CSV reader/pull parser/stream parser with small memory usage
Project URL

Project URL

https://github.com/gwenn/scanner
Source Code Management

Source Code Management

https://github.com/gwenn/scanner

Download scanner

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
com.google.code.findbugs : jsr305 jar 3.0.1

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Yet another CSV reader/pull parser/stream parser with small memory usage.

All credit goes to:

  • Rob Pike, creator of Scanner interface,
  • D. Richard Hipp, for his CSV parser implementation.

Build Status Maven Central Javadocs

Iterating over fields

CsvScanner s;
while (s.scan())) {
  String value = s.value();
  // ...
  if (s.atEndOfRow()) {
    // ...
  }
}

Iterating over records

CsvReader r;
while (r.next()) {
  String value1 = r.getString(1);
  // ...
}

Round Tripping

CsvWriter w;
CsvScanner s;
while (s.scan())) {
  w.write(s.value());
  if (s.atEndOfRow()) {
    w.endOfRow();
  }
}
w.flush();

or

CsvWriter w;
CsvReader r;
while (r.next()) {
  w.writeRow(r.values());
}
w.flush();

LICENSE

Public Domain

Versions

Version
0.1.0