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

Using different left and right quote characters with openCSV in Java

I'm trying to read a CSV file in Java using openCSV. However the csv file uses < and > as quote characters instead of ". According to this there is a way to change the quote character used, but is it possible to change to < and >? If so, how?
GDanger
  • 1,641
  • 2
  • 22
  • 35
0
votes
0 answers

Classify huge CSV file by tag name

I have a large size CSV file that is almost 60MB. This CSV file contains Object_Name, timestamp, and value. In the CSV file, there are 10 objects that are listed in csv file based on time sequence, but those are overlap. such as : A1,2013-08-24…
Eric
  • 1,271
  • 4
  • 14
  • 21
0
votes
1 answer

openCSV CSVReader expects rows with same number of fields?

I have a csv encoding a thesaurus of some items and, expectedly, the number of entries per row are different for different rows. The first line contains 25 tokens/synonyms. The rest of the lines have lesser. But the String[] that are read all have…
Navneet
  • 9,590
  • 11
  • 34
  • 51
0
votes
1 answer

Lenient CSV parsing

Most java based CSV parsing implementations seem to discard the remainder of the stream in case of csv format errors. Examples are OpenCSV (which silently terminates processing) and CSVeed (which terminates noisily with a line and column…
qwerty
  • 3,801
  • 2
  • 28
  • 43
0
votes
3 answers

OpenCSV newbie: how to get content from specific cells

I'm trying to get whatever is under a specific header and turn that into a String. I want my code to recognize a header and get the content right under it. Basically get info in a specific cell. What am I doing wrong? I know how to do this by…
0
votes
2 answers

Using OpenCSV to extract specific numbers from CSV

I have CSV files with headers and specific numbers. I need to extract those numbers individually to create a AIM XML file with, but that's not important. I'm having a hard time trying to extract the numbers based on the their headers. I've tried…
0
votes
3 answers

OpenCSV reader for Java - how to get the number of columns?

I have OpenCSV reader in a Java project and its reading data from CSV files for me, but right now Im hardcoding the number of colums in the loop that reads it. I can recall there was some method that could get the number of columns but I dont…
Kaloyan Roussev
  • 14,515
  • 21
  • 98
  • 180
0
votes
1 answer

csv FileNotFoundException: ENOENT

I am trying to access a csv file from the assets for my app and all I get is FileNotFoundException. I get the same when I try to access it from elsewhere. Any idea what I should be doing here? Log messages work just fine until then. The error on…
0
votes
1 answer

Trouble Finding CSV File (with and without OpenCSV) in Eclipse for Android

I'm having trouble reading from a csv file for my Android project. I'm using a Mac, with Eclipse ADT, and have imported OpenCSV. The problem that I keep running into is that the file is not found. I have tried putting it everywhere, including: in…
user2323030
  • 1,193
  • 4
  • 16
  • 37
0
votes
2 answers

Finding Column Number using OpenCSV

I am using openCSV package in Java to create CSVs. I am creating a CSV with two columns. First Column represents first name of a person. Second Column represents second name of a person. So, it is like Deepak, Prasath Rakesh, Mehra Prakash,…
N Deepak Prasath
  • 385
  • 2
  • 4
  • 13
0
votes
2 answers

Database or CSV to java object

For now I have a CSV with several columns in rows. Eventually, I will have a SQL relational database structure. I was wondering if there are any libraries to easily extract this data into a list of java objects. Example: title | location |…
Brian
  • 7,098
  • 15
  • 56
  • 73
0
votes
1 answer

Run Java Selenium webdriver program from batch file (Not for testing)

I am using Selenium WebDriver, Jsoup, Opencsv, and Java to parse HTML pages including javascript of one website, and then generate csv file. I can run it from Eclipse but I want to automate it using batch file. My java program has two classes -…
Mira
  • 131
  • 2
  • 15
0
votes
2 answers

Write query result from twitter4j into csv using opencsv

I'm using twitter4j to extract tweets from twitter. After i use this line i get a json result: QueryResult result = twitter.search(query); I want to know how to use opencsv to write this into csv. writeAll() is only for List or result set, I want…
0
votes
1 answer

Searching Using opencsv

I wanted to know, if we can search a particular row in a csv (as we do in UI using find) containing a particular word. Does opencsv provide this functionality ? If not, what is the best way to search in csv file.
Amol Sharma
  • 1,521
  • 7
  • 20
  • 40
0
votes
1 answer

Displaying CSV values in ANDROID APPLICATIONS ( After opening the APK )

I have been searching for methods to display the values in my csv files to the Android Applications but were not successful. ( I am a totally beginner for JAVA and Android ) Each time I took the codes to be modified from the internet, my system will…