Questions tagged [supercsv]

Super CSV is a fast and free open-source CSV API for Java.

Super CSV is a fast and free open-source CSV API for Java, written by Kasper Graversen.

The developers of Super CSV follow this tag, so you can receive expert advice on your Super CSV problems by using this tag.

Before asking a question, check the documentation and examples on the project website.

Please note that you can also receive help at the project's GitHub site, as well as report any issues you have encountered.

Related Links:

202 questions
1
vote
3 answers

Skip Optional Header in CSV file with SuperCSV

I have a system where users can import data through csv files. The file is parsed to POJOs using SuperCSV. I want to be able to manage these files with or without the header row. CsvBeanReader.getHeader(true) will extract the first row, but if it is…
Artwar
  • 11
  • 1
  • 5
1
vote
1 answer

adding multiple columns to a csv file

Here is my existing csv file: userid,name 1,Jim 2,Sally 3,Bob I can add another column using CsvMapReader/Writer and make it look like: userid,name,time 1,Jim,64913824823208 2,Sally,64913824900056 3,Bob,64913824966956 However, if I want to add…
khalibali
  • 123
  • 1
  • 2
  • 16
1
vote
2 answers

How do I skip white-space only lines and lines having variable columns using supercsv

I am working on CSV parser requirement and I am using supercsv parser library. My CSV file can have 25 columns(separated by tab(|)) and up to 100k rows with additional header row. I would like to ignore white-space only lines and lines containing…
Kiran
  • 45
  • 6
1
vote
1 answer

Validate each filed against multiple constraints using CSV Parser

I am working on a requirement where I need to parse CSV record fields against multiple validations. I am using supercsv which has support for field level processors to validate data. My requirement is to validate each record/row field against…
Kiran
  • 45
  • 6
1
vote
1 answer

Changing escape character for quotes

I am trying to read a CSV file which contains escaped quote values such as: "1","unquoted text","\"quoted text\"" It seems that SuperCSV wants quotes to be quoted as "1","unquoted text","""quoted text""" Is there a way to change the escape…
Nayan Hajratwala
  • 350
  • 1
  • 4
  • 11
1
vote
1 answer

Merging multiple csv files in java

I have 3 csv files. Each file contains 10 columns but only 1 of them has different values. Dutch French English As shown in the pictures, only the destination name is different per language. What I want to become is csv file looking like…
Glenn Van Schil
  • 1,059
  • 3
  • 15
  • 33
1
vote
1 answer

Continue SuperCSV Read After Exception

Is there a way to continue reading from the CSV after a cell processor exception is thrown? I'm attempting to take all of the good data from a file, do what I need with it, and report back to a user what, if any, bad lines are present. For example,…
Curtis Snowden
  • 407
  • 1
  • 4
  • 20
1
vote
1 answer

Java Create 100MB zipped csv file performance issue

I need to create 100mb zipped file within 5 seconds which contains a CSV file using java. I have created test.zip which contains the CSV file but it is taking too much time (~30 seconds) to generate the zip file. Here is the code that I've written…
1
vote
0 answers

Using Super-csv with a java class that has a class as a property

I am using Super-CSV to write a CSV file but I am having problems when I want to access a property in a class that is also a property of the original class. I'll try to explain myself better: I have let's say class Car, which has a property Model…
diminuta
  • 1,545
  • 8
  • 32
  • 55
1
vote
1 answer

Supercsv example doesn't compile

This example straight from the docs at http://super-csv.github.io/super-csv/examples_reading.html doesn't compile. All lines in the new CellProcessor[]{...} generate the error "Incompatible types. Required: CellProcessor…
fred
  • 1,812
  • 3
  • 37
  • 57
1
vote
1 answer

SuperCSV Joda time LocalDate cell processor to accept more than one date format

Using SuperCSV I am utilizing the ParseLocalDate cell processor for Joda time: private static CellProcessor[] processors = new CellProcessor[] { new Optional(new ParseLocalDate(DateTimeFormat.forPattern("MM/dd/yyyy"))) }; This works great.…
adamconkey
  • 4,104
  • 5
  • 32
  • 61
1
vote
3 answers

SUPER CSV write bean to CSV

Here is my class, public class FreebasePeopleResults { public String intendedSearch; public String weight; public Double heightMeters; public Integer age; public String type; public String parents; public String profession; public String…
ButtersB
  • 495
  • 1
  • 7
  • 14
1
vote
1 answer

SuperCSV with Dozer - How to map to a List of Lists?

Using SuperCSV with Dozer (version 2.2.0), I've been able to successfully map data into a List. However, I now have a case where I want to map into a List of Lists. In the object I'm trying to map to, I have a field that looks something like…
dnc253
  • 39,967
  • 41
  • 141
  • 157
1
vote
1 answer

SuperCSV reading from multiple files and parsing into one bean object

I am currently trying to read in multiple CSV files using beanReader before taking a few columns from each and parsing them into one bean. So far I cannot seem to parse columns from different files into one bean object. Is this even possible with…
joey7492
  • 117
  • 3
  • 3
  • 12
1
vote
1 answer

How to display localized error messages in Super CSV

My mother tongue is Spanish and I would like to know how to localize the error messages displayed by Super CSV's cell processors without compiling the source again.