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
0 answers

Mapping CSV column to POJO class when using Super CSV

I need to map a CSV column name to a POJO class in JAVA. But the names in the CSV files and Java classes are a little different. Also, I don't need all columns in the CSV files to be mapped to POJOs, I only need certain columns. Tried mapping using…
1
vote
0 answers

Get Total number of rows in CSV with Super CSV

I need to get access to the number of rows for a CSV being processed but it seems Super CSV does not have an out-of-the-box option. The code below seems to do the trick: private int getCsvFileTotalRows(InputStream inputStream) throws IOException { …
Carlos Gonzalez
  • 607
  • 1
  • 5
  • 13
1
vote
1 answer

How to apply quote character on every field using custom CsvPreference

I'm using super csv https://super-csv.github.io/super-csv/apidocs/org/supercsv/prefs/CsvPreference.html to create csv file. It works great. But I need to set quotes around all fields, not only those that have a comma. So instead of…
john
  • 647
  • 5
  • 23
  • 53
1
vote
0 answers

SuperCSV skips first line while reading CSV file

I'm Using SuperCSV api to read CSV files and and validates their entries. For a reason, it seems that every read it skips the first row. i do not have Headers on my csvs, and i do need the first row. I have tried using : CsvMapReader and…
Yaniv Levy
  • 78
  • 10
1
vote
2 answers

Out of Memory Error in CSV Export methods with Spring MVC

We've been having problems with our app where it runs out of memory when producing a CSV file. Specifically on big CSV files where there are more than 10k rows. We are using Spring Boot 2.0.8, and SuperCSV 2.4.0. What would be the correct approach…
Nimchip
  • 1,685
  • 7
  • 25
  • 50
1
vote
0 answers

Using is method instead of a getter method

can I tell supercsv that the class has an is method instead of a getter? public class Decision { private boolean isAccepcted; public boolean isAccepcted() { return isAccepcted; } public boolean getIsAccepted() { …
BB-8
  • 45
  • 4
1
vote
1 answer

Superscript characters are resulting in to junk characters in generated CSV file when using ICsvListWriter

I am trying to write superscript characters in .csv file. I am using method write(List columns)of org.supercsv.io.ICsvListWriter. In generated .csv file the superscript character is coming along with junk character before it. List columns = new…
Nags
  • 273
  • 1
  • 4
  • 16
1
vote
0 answers

Supercsv not skipping comments even with proper skip preferences

I am trying to read CSV file and ignore the comments rows starting with "#". I believe I am setting the right preferences to ignore the comments but still, it is not getting ignored. Can anyone suggest what am i doing wrong. …
Abhi.G
  • 1,801
  • 5
  • 20
  • 35
1
vote
1 answer

Why does my CSVMapper put quotes around some Strings and not others?

I have a class like this: @JsonPropertyOrder({"Chilli"}) public interface ChilliReport { @JsonProperty("Chilli") String getChilli(); @JsonProperty("Price") String getPrice(); } // Then, I'll populate this with some…
Vicky
  • 99
  • 1
  • 1
  • 6
1
vote
2 answers

Out of memory with superCSV java library

Here is the code that counts the number of lines in a file. It works with BufferedReader and is fine. No problem . In total there are over 25,000,000 rows BufferedReader br = new BufferedReader(new FileReader("C:\\...test.csv")); int…
john
  • 647
  • 5
  • 23
  • 53
1
vote
1 answer

How do get a csv with custom header names instead of bean field names using SuperCSV?

I am using supercsv 2.2.0 as a dependency for my project. My bean which I want to populate in csv is: public class Book { private String title; private String description; private String author; private String publisher; private…
The-Proton-Resurgence
  • 808
  • 1
  • 13
  • 28
1
vote
1 answer

ParseEnum (method) cannot parse/read String as enum from .csv file in SuperCSV (Java)

this weekend I tried out your great framework and would like to use it in production. Unfortunately my Employee Bean has an attribute sexuality which is of type enum. Somehow the integrated official ParseEnum cellprocessor cannot parse the sexuality…
Chiggiddi
  • 542
  • 1
  • 8
  • 26
1
vote
0 answers

Supercsv :The output csv file has a messed up rows

I am currently using SuperCSV (v 2.4.0) for exporting data. I am stuck in with the below problem. ※My problem: - My CSV header has 9 columns -There is a line which missing a comma dilimiter (,) between two fields, so that line become a 8-columns…
Vô Tình
  • 11
  • 1
1
vote
1 answer

Reading nested POJO with super-CSV

I was trying to load a nested POJO with CSV . For some error I couldnt make it work. Please find my code below. The below class Person contains two POJO field address and attribs public class Person { public String firstname; public…
Freaky Thommi
  • 756
  • 7
  • 18
1
vote
2 answers

For xlsx cell data when converting to CSV using apache POI

I am converting xlsx to csv using below program and I would like to add quote characters("") each cell string if it contains line break(/n) or delimiter character. import java.io.File; import java.io.FileInputStream; import…
Kiran
  • 921
  • 1
  • 11
  • 23