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

Can't find CSV file in DDMS view?

I have a CSV file I am creating with the following code: package com.tukajo.ioiograph; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import…
Timothy Frisch
  • 2,995
  • 2
  • 30
  • 64
0
votes
2 answers

SQL Server SSIS CSV flat file import > do stuff with that data > INSERT/UPDATE to SQL Table

I am currently working on a prototype to create a package to crunch some data. There is a nightly CSV output from an Informix box for which there is an intention to make redundant. My plan is to read this CSV using BIDS, do stuff with the data,…
Splunk
  • 491
  • 1
  • 9
  • 24
0
votes
1 answer

CSV Reader empty values java

I have this CSV: 0,102000082,,2,125,'Battery location','Left-hand drive',2,2 0,300000029,102000082,3,895,'Behind the cab','Left',2,-7 0,102000082,,4,127,'Battery location','Right-hand drive',4,4 ^----- I use csvReader to map to a bean …
alex1111
  • 71
  • 9
0
votes
2 answers

getAssets().open doesn't open my .csv file

I want to assignt my CSVreader from the openCSV api to a CSV file, but it can't find it, as I get an "cannot resolve symbol" error. code: CSVReader csvReader = new CSVReader(getAssets().open(testCSV.csv)); I'm using Android Studio, and the file…
Chimpanse
  • 250
  • 1
  • 5
  • 17
0
votes
0 answers

Exporting resultset

I'm very new to Java and am looking for some assistance. I have a resultset that I'm able to either print (without titles, but that's for a different time), or can produce a jtable. Ultimately, though, I want to be able to send it to excel. I…
0
votes
2 answers

OpenCSV - read all line

I have a problem with the java librairie OpenCSV. I didn't succeed to read all line of my CSV file, I read only the second line, I don't know why ... My CSV file : "NumACLEB","Nom","Prenom","Niveau","Telephone","Portable","Rue","Code…
Aureo91
  • 71
  • 7
0
votes
1 answer

How can i write more than 1 database Table into one .csv file using open CSV?

I am tring to write more than one databaase table into a single csv file. how can i do that. this is my current code for writing into my CSV using OPEN csv. try { ResultSet query_set1 = stmt2.executeQuery("SELECT * FROM ARTIFACT_VERSION T1 INNER…
Aman
  • 85
  • 9
0
votes
2 answers

Getting Null Pointer Exception while running a test through TestNG

I am using CSV reader to fetch the data from and using this data in a test function using DataProvider. TestNG Method @Test(dataProvider = "regCSVData", dataProviderClass = LoginData.class) public void testLoginUsingCSVFile(LoginData loginData){ …
Paras
  • 3,197
  • 2
  • 20
  • 30
0
votes
1 answer

Searching a CSV file repeat error

I am searching a csv file using the month in the date: Jackson,Samantha,2 Heather Row,Basingstoke,RG21 3SD,01256 135434,23/04/1973,sam.jackson@hotmail.com Vickers,Jonathan,18 Saville Gardens,Reading,RG3 5FH,01196…
user3165683
  • 347
  • 1
  • 9
  • 28
0
votes
1 answer

Unnecessary double quotes added to rows of CVS file when opening with notepad/notepad++

I am creating a CSV file using openCsv jar. If I am opening generated CSV file in spreadsheet then its fine. But same if I open with notepad/Notepad++ then its adding extra double inverted comma in each row. Any help how can I fix that?
Immy
  • 57
  • 2
  • 10
0
votes
1 answer

serialize csv file into an object in jersey service

i am trying to write a jersey service which consumes a CSV file. i want to serialize that csv file into an object. what can i do to achieve this? i am going to use opencsv as the parser library for csv file. my base structure of the…
Gaurav Sood
  • 680
  • 4
  • 17
  • 38
0
votes
1 answer

java CSVReader and CSVWriter producing unexpected results

I'm using Java CSVReader and CSVWriter from OpenCSV public static void main(String[] args) throws IOException { File inputFile=new File("e:\\temp\\5.csv"); File outputFile=new File("e:\\temp\\5_out.csv"); CSVReader…
user121196
  • 30,032
  • 57
  • 148
  • 198
0
votes
1 answer

Exporting CSV in french language shows junk charcters

I am having a problem in exporting a csv file using au.com.bytecode.opencsv.CSVWriter. I did something like: File file = File.createTempFile("UserDetails_", ".csv"); CSVWriter writer = new CSVWriter(new OutputStreamWriter( new…
NDeveloper
  • 3,115
  • 7
  • 23
  • 34
0
votes
1 answer

OpenCSV & Java: Method Skips A Line Every Time It Is Run?

What I am trying to do: Using OpenCSV, Write a method that will allow me to get information from a particular column in a CSV. This CSV will (in practice) only have two rows: A header row, and one row of information. I need to take certain bits and…
Vladimir Marenus
  • 393
  • 2
  • 3
  • 16
0
votes
1 answer

junit/selenium - Parsing from csv(opencsv) to check value

Currently i am using openCsv to parse my test.csv, and use the data extracted to do assert checks in selemium/junit. The data in my csv, 1 2 3~ ~ is my delimiter I want to compare the data in my csv with my selenium .getText(), However, i…
user2853922
  • 27
  • 1
  • 3
  • 7