A fast, programmer-friendly, free CSV library for Java

Related tags

CSV super-csv
Overview

super-csv

Coverage Status Build Status Join the chat at https://gitter.im/super-csv/super-csv

Dear super-csv community, we are looking for people to help maintain super-csv. See https://github.com/super-csv/super-csv/issues/47

Super CSV is a fast, programmer-friendly, open-source library for reading and writing CSV files with Java. It is used by a number of large projects and is being downloaded 19000+ times/month from the Maven repository.

It is highly configurable, and supports reading and writing with POJOs, Maps and Lists. It also has support for deep-mapping and index-based mapping with POJOs, using the powerful Dozer extension.

Its flexible 'Cell Processor' API automates data type conversions (parsing and formatting Dates, Integers, Booleans etc) and enforces constraints (mandatory columns, matching against regular expressions etc) - and it's easy to write your own if required.

Super CSV is actively maintained, and the developers are ready and willing to help out if you get stuck :)

Please check out the documentation for examples and help getting started.

Also do have a look at my personal blog on programming and code quality at http://firstclassthoughts.co.uk/

Comments
  • New release?

    New release?

    Hi team, is it time to soon do a release? I guess we need to update the version log with all the stuff. Currently 44 commits have been made since last release.

    opened by kbilsted 38
  • Add JDBC ResultSet writer. Closes #6

    Add JDBC ResultSet writer. Closes #6

    Add a writer to write a JDBC ResultSet as CSV.

    CsvResultSetWriter writes a CSV file by mapping each column of the ResultSet to a column in CSV file using column names stored in ResultSetMetaData. It can be used with or without CellProcessors.

    Closes issue #6.

    opened by vyacheslav-pushkin 23
  • Create a test suite showing all the features of supercsv

    Create a test suite showing all the features of supercsv

    An idea could be to create a unit test called "FeaturesOfSuperCsv" which has a test for each row of the comparison matrix showing that supercsv in fact has this feature. Missing features should be made into individual issues which the community then can implement or reject.

    this test is nice for

    • new people on the team
    • people doing comparisons
    • for linking from the documentation pages

    features to show can be found in

    • the existing documentation
    • http://csveed.org/comparison-matrix.html
    • https://github.com/uniVocity/csv-parsers-comparison
    documentation 
    opened by kbilsted 21
  • Add custom field mapping to CsvBeanReader

    Add custom field mapping to CsvBeanReader

    Add additional overloaded read() methods to CsvBeanReader that accepts column name mappings and cell processors as maps instead of arrays. The new methods:

    • allows to read beans directly from CSV when CSV headers are different than bean field names
    • has no dependency on columns number or order
    • are more convenient in case of CSV files with large number of columns

    Closes issue #65

    opened by vyacheslav-pushkin 17
  • Quote Escape Character

    Quote Escape Character

    This is meant to support reading data where the quote escape character is not the RFC-compliant second quote character, but instead a separate escape character, commonly a backslash ''.

    RFC-compliant row:

    one,"two","three with a "" quote character",four
    

    Row this PR is meant to support:

    one,"two","three with a \" quote character",four
    

    We want to be able to parse both to this resulting list:

    [one, two, three with a " quote character, four]
    

    General definition for the quoteEscapeChar is:

    • By default the quoteEscapeChar is set to the quoteChar
    • To write an escape char into actual data, double the escape char
    • An escape char before normal data results in both chars being passed through
    • Continue to write data in normal RFC-compliant

    Please see additional unit tests written to support this feature and note that no existing unit tests needed to be modified to support this new option, indicating the existing behavior is unchanged.

    Fixes https://github.com/super-csv/super-csv/issues/14

    opened by ash211 16
  • Super CSV JSR 310 support

    Super CSV JSR 310 support

    Hi,

    I have created default parsers and formatters for the JSR310 date types https://github.com/ludovicofischer/super-csv-jsr310. Would you be interested in having it inside the main supercsv repository like the Joda formatters? The code is a port of the joda extras. It works but it needs some more testing.

    opened by ludofischer 14
  • Do not throw exception when line size mismatch

    Do not throw exception when line size mismatch

    Hi,

    I have a problem using supercsv. Sometimes, I have to deal with some "incorrect" CSV files like that :

    "header1";"header2" "value1";"value2";

    As you can see, I have 2 headers and 3 values in the second line. This prevent me from doing a partial read. This is the same case when executing CellProcessors.

    Is it ok for you ?

    question 
    opened by chameleooo 14
  • Super CSV doesn't pass the Turkey Test

    Super CSV doesn't pass the Turkey Test

    Super CSV doesn't work when your locale is Turkey: reflection fails because it looks for getters/setters in the format: setİsActive /getİsActive (not the capital I is not normal).

    There's so many places in the code where this could be an issue that I'm reluctant to attempt to make Super CSV pass the Turkey Test - I don't think Dozer would pass this test either. But if this ticket gets enough love then we could look at it.

    Originally raised on SourceForge

    bug copied from sourceforge 
    opened by jamesbassett 12
  • ParseTime

    ParseTime

    Hi, I implemented the new ParseTime to convert String to Time Objects. I created an abstract class (ParseDateTimeAbstract) extended by ParseDate and ParseTime. I modified also JUnit test adding the birthTime to PersonBean.

    Pietro

    enhancement 
    opened by pietroaragona 10
  • Support backslash escaping (configurable escape character)

    Support backslash escaping (configurable escape character)

    Super CSV escapes embedded quotes per RFC4180, e.g.

    "This is what ""embedded quotes"" look like"
    

    Some CSV files don't adhere to RFC4180, and use a \ (backslash) character instead 2 quote characters, e.g.

    "This is what \"embedded quotes\" look like"
    

    Add an escapeCharacter preference (defaults to quoteCharacter) that allows for this (with a disclaimer that it makes CSV less portable and doesn't comply with RFC4180.

    Originally raised as Feature Request 42 on SourceForge.

    enhancement help wanted copied from sourceforge 
    opened by jamesbassett 10
  • Create Java code-style for IntelliJ

    Create Java code-style for IntelliJ

    In project we have Eclipse code-style configuration file - supercsv_eclipse_formatter.xml. I think, it would be great if we could create the same for IntelliJ and add it to project.

    Requirements:

    1. Code formatted in Eclipse and IntelliJ should looks the same.
    opened by ZioberMichal 9
  • Supercsv v3 minimum requirements

    Supercsv v3 minimum requirements

    The existing package is fairly old. What are peoples preference in terms of minimum required java version for the next version? Which language features should be leveraged? E.g. Modules.

    help wanted question 
    opened by kbilsted 1
  • Bug inside ConvertNullTo cell processor (with test)

    Bug inside ConvertNullTo cell processor (with test)

    Recently brought an ancient project up to date and now blanks are no longer trimmed (great btw) my tests discovered that chaining is broken for ConvertNullTo.

    It's implementation of the execute should be:

    public <T> T execute(final Object value, final CsvContext context) {
    	if (value == null) {
    		return next.execute(returnValue, context);
    	}
    	
    	return next.execute(value, context);
    }
    

    (the 3rd line is normally return returnValue;)

    To test it, just use a cell processor like: new ConvertNullTo("-1", new ParseLong())

    Thanks for Super CSV btw, I love it :-) (which is why I bothered raising the issue, because I could easily fix it locally).

    opened by brbog 0
  • Bump h2 from 1.3.171 to 2.1.210 in /super-csv-benchmark

    Bump h2 from 1.3.171 to 2.1.210 in /super-csv-benchmark

    Bumps h2 from 1.3.171 to 2.1.210.

    Release notes

    Sourced from h2's releases.

    Version 2.1.210

    Two security vulnerabilities in H2 Console (CVE-2022-23221 and possible DNS rebinding attack) are fixed.

    Persistent databases created by H2 2.0.x don't need to be upgraded. Persistent databases created by H2 1.4.200 and older versions require export into SQL script with that old version and creation of a new database with the new version and execution of this script in it.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Java 9 Modularity

    Java 9 Modularity

    Unfortunately, due to unfortunate naming, SuperCSV 2.4.0 can't be used in modularized projects:

    [WARNING] Can't extract module name from super-csv-2.4.0.jar: super.csv: Invalid module name: 'super' is not a Java identifier
    

    This PR adds explicit modules:

    • Project is migrated to Java 9.
    • The java8 folder is merged to the main project.
    opened by cernoch 0
  • Avoid ambiguous assertEquals()

    Avoid ambiguous assertEquals()

    The assertEquals(...) calls in tests were ambiguous. For example, when called with (long, Long) parameters, both assertEquals(Object,Object) and assertEquals(long,long) were applicable. This PR makes the calls unambiguous.

    opened by cernoch 0
uniVocity-parsers is a suite of extremely fast and reliable parsers for Java. It provides a consistent interface for handling different file formats, and a solid framework for the development of new parsers.

Welcome to univocity-parsers univocity-parsers is a collection of extremely fast and reliable parsers for Java. It provides a consistent interface for

univocity 874 Dec 15, 2022
Fast and Easy mapping from database and csv to POJO. A java micro ORM, lightweight alternative to iBatis and Hibernate. Fast Csv Parser and Csv Mapper

Simple Flat Mapper Release Notes Getting Started Docs Building it The build is using Maven. git clone https://github.com/arnaudroger/SimpleFlatMapper.

Arnaud Roger 418 Dec 17, 2022
The Apache Commons CSV library provides a simple interface for reading and writing CSV files of various types.

Apache Commons CSV The Apache Commons CSV library provides a simple interface for reading and writing CSV files of various types. Documentation More i

The Apache Software Foundation 307 Dec 26, 2022
A programmer-oriented testing framework for Java.

JUnit 4 JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. For more infor

JUnit 8.4k Jan 4, 2023
OpenMap is an Open Source JavaBeans-based programmer's toolkit. Using OpenMap, you can quickly build applications and applets that access data from legacy databases and applications.

$Source: /cvs/distapps/openmap/README,v $ $RCSfile: README,v $ $Revision: 1.11 $ $Date: 2002/11/06 19:11:02 $ $Author: bmackiew $ OpenMap(tm) What

OpenMap 65 Nov 12, 2022
Tank - a beginner-friendly, fast, and efficient FTC robot framework

Tank beta a beginner-friendly, fast, and efficient FTC robot framework Overview tank is a FTC robot framework designed to be beginner-friendly, fast,

Aarush Gupta 1 Jan 8, 2022
Library that makes it possible to read, edit and write CSV files

AdaptiveTableLayout Welcome the new CSV Library AdaptiveTableLayout for Android by Cleveroad Pay your attention to our new library that makes it possi

Cleveroad 1.9k Jan 6, 2023
Password4j is a user-friendly cryptographic library that supports Argon2, Bcrypt, Scrypt, PBKDF2 and various cryptographic hash functions.

Password4j is a Java user-friendly cryptographic library for hashing and checking passwords with different Key derivation functions (KDFs) and Cryptog

Password4J 246 Jan 5, 2023
Bank Statement Analyzer Application that currently runs in terminal with the commands: javac Application.java java Application [file-name].csv GUI coming soon...

Bank Statement Analyzer Application that currently runs in terminal with the commands: javac Application.java java Application [file-name].csv GUI coming soon...

Hayden Hanson 0 May 21, 2022
High performance CSV reader and writer for Java.

FastCSV ?? FastCSV 2.0 upgrade has landed with major improvements on performance and usability! FastCSV is an ultra-fast and dependency-free RFC 4180

Oliver Siegmar 411 Dec 22, 2022
Text Object Java Objects (TOJOs): an object representation of a multi-line structured text file like CSV

It's a simple manager of "records" in a text file of CSV, JSON, etc. format. It's something you would use when you don't want to run a full database,

Yegor Bugayenko 19 Dec 27, 2022
Persistent cluster-friendly scheduler for Java

db-scheduler Task-scheduler for Java that was inspired by the need for a clustered java.util.concurrent.ScheduledExecutorService simpler than Quartz.

Gustav Karlsson 714 Dec 31, 2022
Java friendly DSL for defining TestFX tests

TestFX-DSL aims to bring DSL capabilities on top of TestFX. Inspired by Geb, this DSL enables a fluent interface design on top of the facilities exposed by TestFX.

Andres Almiray 5 Aug 21, 2019
A simple JavaFX application to load, save and edit a CSV file and provide a JSON configuration for columns to check the values in the columns.

SmartCSV.fx Description A simple JavaFX application to load, save and edit a CSV file and provide a JSON Table Schema for columns to check the values

Andreas Billmann 74 Oct 24, 2022
A maven plugin to include features from jmeter-plugins.org for JMeterPluginsCMD Command Line Tool to create graphs, export csv files from jmeter result files and Filter Result tool.

jmeter-graph-tool-maven-plugin A maven plugin to create graphs using the JMeter Plugins CMDRunner from JMeter result files (*.jtl or *.csv) or using F

Vincent DABURON 6 Nov 3, 2022
Uber-project for (some) standard Jackson textual format backends: csv, properties, yaml (xml to be added in future)

Overview This is a multi-module umbrella project for Jackson standard text-format dataformat backends. Dataformat backends are used to support format

FasterXML, LLC 351 Dec 22, 2022
Metrobank CSV file reader.

BankTransactionReader The application reads an input CSV file with bank transactions and computes total income and expenses for the whole file, presen

Elza Contiero 0 Sep 1, 2022