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
5
votes
3 answers

Java CSV parser with unescaped quotes

I have a CSV file that has some quoting issues: "Albanese Confectionery","157137","ALBANESE BULK ASST. MINI WILD FRUIT WORMS 2" 4/5LB",9,90,0,0,0,.53,"21",50137,"3441851137","5 lb",1,4,4,$6.7,$6.7,$26.8 SuperCSV is choking on these fruit worms (pun…
Hut8
  • 6,080
  • 4
  • 42
  • 59
5
votes
4 answers

How do I upload a CSV file and then automatically insert the data into the DB?

I have Java based Spring MVC application that also uses Spring security. I am using hibernate as an ORM tool for this web app. Following is my requirement -- User will have ability to upload a CSV file using a web browser. The format of the CSV…
texasdude11
  • 587
  • 1
  • 6
  • 15
4
votes
2 answers

How to deal with CSV files having an unknown number of columns using Super CSV

For a project I need to deal with CSV files where I do not know the columns before runtime. The CSV files are perfectly valid, I only need to perform a simple task on several different files over and over again. I do need to analyse the values of…
Stefan
  • 679
  • 2
  • 9
  • 21
4
votes
3 answers

Messed up CSV leads to Exception

I think i found a bug. Or maybe it isn't, but Super CSV can't handle that well. I'm parsing a CSV file with 41 Columns with a MapReader. However, i'm getting that CSV - and the Webservice that gives me the CSV messes up one line. The "headline" line…
Stefan
  • 2,028
  • 2
  • 36
  • 53
4
votes
2 answers

How do I use Super CSV on a delimited file that does not use a quote character?

I'm using Super CSV to parse a pipe ("|") separated file. The file does not use "text qualifiers", or what Super CSV calls a quote character. The problem is that Super CSV requires a quote character. I don't see a way to skip this, or provide a null…
Jeremy Ross
  • 11,544
  • 3
  • 36
  • 36
4
votes
2 answers

Use superCSV to read a large text file of 80GB

I want to read a huge csv file. We are using superCSV to parse through the files in general. In this particular scenario, the file is huge and there is always this problem of running out of memory for obvious reasons. The initial idea is to read…
Nikhil Das Nomula
  • 1,863
  • 5
  • 31
  • 50
3
votes
3 answers

Looking for a java CSV library that allows reading columns by name

Also, allows handling of long rows in a readable/easy manner, in writing them as well as in reading them. I've looked into opencsv but it does not refer to elements in row in any sequential fashion, and supercsv does not allow looking into column…
akapulko2020
  • 1,079
  • 2
  • 22
  • 36
3
votes
2 answers

Skipping alternate lines while reading .tsv file

I have a .tsv file which has 39 column the last but one column has data as string whose length in more than 100,000 characters Now what is happening is when i am trying to read the file line 1 has headers and then the data follows What is happening…
Subhrajyoti Das
  • 2,685
  • 3
  • 21
  • 36
3
votes
1 answer

Using SuperCsv with multiple variable columns

I was looking at this example from the Super CSV website which shows that dateofbirth is optional column. What happens if i have more than one optional columns? How will the code change than? private static void…
v0ld3m0rt
  • 866
  • 3
  • 12
  • 47
3
votes
2 answers

SuperCSV append rather than overwrite?

Is it possible to add new lines to a CSV file, rather than overwrite the last one? Here is my method I call when I want to add a new line: private static void writeWithCsvMapWriter() throws Exception { final String[] header = new String[] {…
dev6546
  • 1,412
  • 7
  • 21
  • 40
3
votes
2 answers

java.lang.NoSuchMethodError: java.lang.String.isEmpty

I am using an external library called superCSV and this library apparently makes use of isEmpty. After a search on SO, I found that this method was introduced in 2.3 and indeed the crash I am getting is from 2.2 Is there anyway I can fix it that…
Snake
  • 14,228
  • 27
  • 117
  • 250
3
votes
1 answer

Abilities of SuperCSV

I'm looking at using SuperCSV to check the contents of some files that I receive. The format of the file is such that it has a header record followed by the data records followed by a CRC32 checksum…
3
votes
2 answers

How do I skip white-space only lines using Super CSV?

How do I configure Super CSV to skip blank or white-space only lines? I'm using the CsvListReader and sometimes I'll get a blank line in my data. When this happens, an exception to the effect of: number of CellProcessors must match number of…
dkantowitz
  • 1,931
  • 1
  • 16
  • 22
3
votes
1 answer

How to partially read a CSV file with Super CSV

I have a csv file with 24 columns. Out of these I only want to read 3 columns. I see that super CSV is a very powerful library, but I can't figure out how to partially read a CSV. The link that have on partial reading is broken. Please do help me…
dev_nut
  • 2,476
  • 4
  • 29
  • 49
3
votes
1 answer

SuperCSV quote every exported cell

I'm using superCSV for exporting bean data to CSV. I'd like every cell double quoted, not just the ones with special characters. Now, using CsvPreference.EXCEL_NORTH_EUROPE_PREFERENCE, even the cells with special characters won't get quoted. (With…
csaadaam
  • 103
  • 1
  • 3
  • 8
1
2
3
13 14