Questions tagged [opencsv]

opencsv is a simple csv (comma-separated values) parser library for Java

What is opencsv ?

opencsv is a simple csv (comma-separated values) parser library for Java. It was developed in response to a lack of csv parsers with commercial-friendly licenses.

Where can I get it?

Source and binaries are available from Sourceforge. You can check out the javadocs online.

What features does opencsv support?

opencsv supports all the basic csv-type things you're likely to want to do:

  • Arbitrary numbers of values per line
  • Ignoring commas in quoted elements
  • Handling quoted entries with embedded carriage returns (ie entries that span multiple lines)
  • Configurable separator and quote characters (or use sensible defaults)
  • Read all the entries at once, or use an Iterator style model
  • Creating csv files from String[] (ie. automatic escaping of embedded quote chars)
1008 questions
-2
votes
1 answer

Merge 2 csv files by common column

I have 2 csv files first.csv and second.csv. They both have a shared column. Example: first : a b c d second: x y a z I have to create a third csv file that looks like this: third : a b c d x y z The files do not have the same number of entries, I…
-2
votes
1 answer

How to load csv file which has no header, data into oracle db using hibernate springboot

Connecting and giving values were very easy ,but I couldn't load the csv data into oracle db I was able to connect db and give data into db. But couldn't load csv file which has no header files
-2
votes
1 answer

How to exctract MAX value of a column and return column name to save it as a variant

I am a very beginner enthusiastic programmer wanna be. I am trying to compare two columns of a csv which I got from Google trends and extract the "Winner word" into a variant or list. So I could compare to other keywords in trends. So far, I…
daniel14
  • 1
  • 2
-2
votes
1 answer

python open() vs pd.read_csv()

a photo of using open() and pd.read_csv() to open a link but open() says no file directory, why do I have an error when I used open() but pd.read_csv opened the file, I tried using it again but it says file not found?
-2
votes
1 answer

How to read a CSV file, remove a column, and replace the file

I have a CSV file in my local folder. I would like to read it, remove a column, and replace the file in the same folder. Actual sample data: ID,EMAIL,FIRSTNAME,LASTNAME …
ychaulagain
  • 73
  • 1
  • 8
-2
votes
1 answer

How to write into an output stream with content is csv using opencsv?

@Value("classpath:tpls/Non-PnL_Template_Export_Order_Cross_Checking.csv") private org.springframework.core.io.Resource exportFileOrderTpl; I create an output stream of a CSVWriter InputStream inputStream =…
Loint
  • 3,560
  • 7
  • 26
  • 46
-2
votes
1 answer

How can I save my html parsed data as a CSV file?

I have made all the necessary imports (Jsoup Elements and Element) and the code runs well. I am a beginner and couldn't make the file export properly as a CSV. The data either stays on the same row or the same column. Document document =…
-2
votes
2 answers

java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 when trying to read csv

I have problem when trying to read the csv file, the error appears like this : java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 . I have tried searching in StackOverflow, the error appears same as above. Code : private void…
-2
votes
3 answers

How to read multiple line value CSV files in Java?

Since a valid JSON file may contain only one JSON I intend to put multiple JSONs into a CSV file separated by a ";" and to read it using OpenCSV. (It's for putting those JSON data in file apart from the JUnit class to make it better readable.) Is…
du-it
  • 2,561
  • 8
  • 42
  • 80
-2
votes
1 answer

CSV File does not exist , Python, Pandas Dataframe

I've downloaded a csv, let's call it april.csv Then I got an error message, april.csv does not exist. I tried to open it like this: df = pd.read_csv("C:\Users\Lenovo\Downloads\pydata_pandas-master.zip\pydata_pandas-master\data\april.csv") I also…
LizaM
  • 1
  • 1
-2
votes
2 answers

Using openCSV in Java on IntelliJ IDEA

I am so frustrated right now. I was trying to follow this tutorial https://www.callicoder.com/java-read-write-csv-file-opencsv/ to use openCSV in java to read some file. After I set up every thing. I got these error. And, then I did some…
LOTR94
  • 27
  • 7
-2
votes
1 answer

CSV reader fails to return Strings

I have a CSV file that has following form. I read the CSV using CSV reader. It outputs the objects in following form instead of the string. Output [Ljava.lang.String;@138617da ** This is my code. What is wrong with code? public void…
Kumaresp
  • 35
  • 1
  • 12
-2
votes
3 answers

how to write java csv parser using opencsv

I have to parse csv file . number of columns would be variable. I have written following code for fixed columns. I have used csvtobean and MappingStrategy apis for parsing. Please help me how can I create mappings dynamically. public class…
coder
  • 83
  • 9
-2
votes
2 answers

Extract row based on a particular column value using opencsv

I have a huge CSV file which I have read each row and compared against a database table using hash of each row, now I would want to extract certain rows depending on id value from the csv file again. I cannot save the rows initially as I have around…
user3483129
  • 137
  • 6
  • 18
-2
votes
1 answer

Make parser for CSV file to get tons of data

I got some work to extract data from a big CSV file. It has a lot data related to articles and publishers. So I want to make a parser for it in Java to make a data warehouse and show this data in OLAP. Can anyone tell that how can I get started with…