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
2
votes
1 answer

What cellprocessor to use on strings when using SuperCSV CSVBeanReader

@Carl V. Dango ,@Zsolt, @Jon, Let's start over. Here is my code and error (at bottom). You'll notice in the console output the first two lines of raw data. The first field in the first row ("item") is null in the output. I thought it should be…
Davidson
  • 1,064
  • 3
  • 20
  • 35
2
votes
2 answers

Parsing Strings in SuperCSV

@Carlo V. Dango I have simplified my question and I have read the documentation--good advice not to panic. Still, I have problems. Help me solve one and it will solve them all. Thank you. Question: When I have a csv record that is missing a…
Davidson
  • 1,064
  • 3
  • 20
  • 35
2
votes
0 answers

Mapping CSV to multiple nested beans of same type

I am trying to map CSV data row to FlightBooking bean, which has 2 nested beans of same type FlightSegment. CSV header is below for reference: Booking Date,Booking Reference,Total Price,Aviation Taxes,Flight Reference,Flight Date,Flight Price,Seat…
VivekRatanSinha
  • 596
  • 1
  • 4
  • 17
2
votes
0 answers

Write multiple classes to one CSV file

I have a list of objects that are instances of a number of sub-classes of a base class. I've been trying to write these objects out together into one CSV file. Each class contains the fields of the base class and adds a couple of extra fields of…
triadiktyo
  • 479
  • 2
  • 9
2
votes
1 answer

how to export a list of data to csv file in rest api

I am exporting a list of user records to csv file in my sprig boot REST application. I am using supercsv maven dependency for this. My entity class for User & Address is like below. User Class User{ private String userId; private String…
prabeen90
  • 450
  • 3
  • 12
2
votes
1 answer

Java SuperCSV CsvBeanReader Continue Despite Error

I am attempting to read a CSV file then create a new object based on that CSV file. I can successfully do that with the SuperCSV library, but if an error occurs (such as a specific cell is null) it throws an error (as expected). I'm trying to gather…
Drakee510
  • 480
  • 1
  • 5
  • 15
2
votes
0 answers

How to map selected columns to Java Bean?

I have a CSV file with the following columns: id,name,description,price,date,pname,paddress I have taken a nested Course class with id,name,description,price,date,Person data members and person class with pname,paddress I want to map these columns…
tarun
  • 39
  • 4
2
votes
1 answer

Super CSV: Looking for integer equivalent to LMinMax

With supercsv, I can apply minimum and maximum constraints to a long column using LMinMax(), but how can I do that with a column that maps to an integer? If I use LMinMax on a column that maps to an integer in my bean, when I try to read the file in…
2
votes
1 answer

Handle columns with NULL values with SuperCSV

Is there a way to configure how SuperCSV expects to handle NULL values? This is sometimes handled as: ,, or as: ,NULL, or as: ,null, But I can't seem to find a way to configure how SuperCSV expects to handle these, especially for numeric…
robross0606
  • 544
  • 1
  • 9
  • 19
2
votes
2 answers

Selective Serialization to CSV, Java

I am using jsefa library to selectively deserialize a csv for eg. maping only header no. 1,3,5 to my object, this works fine. Now I want to do the opposite of it selectively serialize my object to header postion 1,3,5 and rest positions should get…
Ashish
  • 198
  • 3
  • 11
2
votes
1 answer

Excluding null fields in super csv CsvBeanWriter

I have a class in which some of the fields may be null. I want to ignore such fields in my csv .Looking for functionality similar to @JsonInclude(value = Include.NON_NULL) in jackson. Null fields column header should also not come in CSV
ha22109
  • 8,036
  • 13
  • 44
  • 48
2
votes
1 answer

Super CSV and Grouping Separators

We are trying to read a file that contains numbers in the following format: 123.456,78 (according to Wikipedia this is usual for some countries - e.g. Germany). Super CSV is configured to parse the column as BigDecimal: new ParseBigDecimal(new…
Egga Hartung
  • 1,061
  • 11
  • 23
2
votes
3 answers

CSV parser in JAVA, double quotes in string (SuperCSV, OpenCSV)

all day I've been searching how to resolve this probem and nothing... I want to write function, which convert CSV file to collection of lists (of strings). Here is this function: public Collection> parse() throws IOException…
user3521479
  • 565
  • 1
  • 5
  • 12
2
votes
0 answers

continue to read next line with csvBeanReader even if an exception occured

I' using csvBeanReader to read the row of a csv file. When i use the while loop to read the raws, for example: while( (object = csvBeanReader.read(Class.class, getNameMapping(), processors)) != null ) if an exception occurred, the program will…
user1645419
  • 227
  • 2
  • 3
  • 10
2
votes
1 answer

How can I tell SuperCSV NOT to map empty string to null

I am using ICsvListReader and ICsvListWriter to read and write csv file. I found that the empty string in csv file is converted to null and then output. How can I avoid this happen. I've tried create a new CellProcessor: private CellProcessor[]…
Jusleong
  • 571
  • 5
  • 10
  • 27
1 2
3
13 14