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

Exception in thread "main" org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may not be interacted with

I'm trying to read a CSV file containing more than one 'username' and 'password' using java in selenium . But when I execute the code, I'm only able to execute the login and logout functionality of the first user in the CSV file. After that it is…
Ganga
  • 17
  • 5
0
votes
1 answer

Reading a specific CSV row and display in output box

I'm not after any specific code, just a point in the right direction. As I'm new to this csv thing and a bit stuck. I have a csv file that contains a column of 'Order numbers', Part Description, Quantity, Drawings: 1) What I'm aiming to do is enter…
LesM76
  • 63
  • 1
  • 9
0
votes
1 answer

converting csv to .xls through java in which delimeter sepration is not done properly

I have the below csv file named Vabc.csv REC_STATUS,TRADE_ID, SETTLEMENT_DATE, TRADE_EFFECTIVE_DATE, PAYMENT_TYPE, VERSION, BREAK_DOWN_BUCKET, CAUSE, NUM_CASHFLOWS_AFFECTED, …
sss
  • 161
  • 1
  • 1
  • 13
0
votes
4 answers

Remove duplicate row from CSV file based on a string - JAVA

I have recently scraped TripAdvisor for some review data and currently have a dataset with following structure. Organization,Address,Reviewer,Review Title,Review,Review Count,Help Count,Attraction Count,Restaurant Count,Hotel Count,Location,Rating…
Mahesh De Silva
  • 505
  • 8
  • 20
0
votes
0 answers

Ignore rows having columns less than number of headers in csv - SuperCSV

I am using SuperCSV to parse CSV records into JavaBean. My CSV files have 10 columns with a headers row in starting. These files can have records up to 10k.I want to process records having equal number of columns with headers . Suppose if a record…
Kiran
  • 45
  • 6
0
votes
2 answers

Change date column to integer

I have a large csv file as below: DATE status code value value2 2014-12-13 Shipped 105732491-20091002165230 0.000803398 0.702892835 2014-12-14 Shipped 105732491-20091002165231 0.012925206…
user175084
  • 4,550
  • 28
  • 114
  • 169
0
votes
1 answer

Mention start from this line and at specific line with opencsv

This is the format of the file one will be getting after the end of market. Looking from the format of the file, I have decided to use opencsv for reading the data. Could you please tell me how to make this work as the previous one is…
Kiran
  • 59
  • 7
0
votes
3 answers

readNext() function of CSVReader not looping through all rows of csv [EDIT: How to handle erroneous CSV (remove unescaped quotes)]

FileReader fr = new FileReader(inp); CSVReader reader = new CSVReader(fr, ',', '"'); // writer File writtenFromWhile = new File(dliRootPath + writtenFromWhilePath); writtenFromWhile.createNewFile(); CSVWriter writeFromWhile = new CSVWriter(new…
gnsb
  • 327
  • 3
  • 8
  • 18
0
votes
2 answers

How to process CSV records in which each field is having multiple constraints

I am working on a requirement where I need to parse CSV file records . Each record can have upto 10 fields and for each field there are multiple constraints(should be required field,alphanumeric,numeric etc). I have to validate each field against…
Kiran
  • 45
  • 6
0
votes
2 answers

Java OpenCSV - 2 List comparison and duplication

i am going to make a application, comparising 2 .csv lists, using OpenCSV. It should works like that: Open 2 .csv files ( each file has columns: Name,Emails) Save results ( and here is a prbolem, i don't know if it should be save to table or…
jadupl
  • 210
  • 6
  • 17
0
votes
4 answers

print 3 consecutive column after specific string from CSV

I need to print 2 columns after specific string (in my case it is 64). There can be multiple instances of 64 within same CSV row, however next instance will not occur within 3 columns of previous occurrence. Output of each instance should be in next…
codecombs
  • 9
  • 3
0
votes
1 answer

ColumnPositionMappingStrategy setType is deprecated

Problem: I am using com.opencsv to parse a CSV file and get back an array of java objects. There is a method called setType() that unfortunately is deprecated. I have not been able to find an equivalent method. Dependency:
Menelaos
  • 23,508
  • 18
  • 90
  • 155
0
votes
1 answer

Fastest way to display 10000 markers on Google Maps from a text file? Threading?

I do my reading of lat, long etc values using the Open CSV reader - as I read somewhere that this is faster than using Buffered InputStream Reader? (Is that true?). This reading happens in the "doInBackground" method of the AsyncTask. From the…
0
votes
1 answer

Use OpenCSV to find exact portion of a csv file based on specific row values

I have a CSV file which I am parsing using OpenCSV. The CSV file looks like the…
SaberTooth
  • 157
  • 1
  • 4
  • 15
0
votes
1 answer

MATLAB Refresh - Call function for CSV

I am trying to run a regression on a CSV file that is pulled from online. However, based on the code below, the CSV file isnt being pulled every time the loop runs and the regression is happening on the same CSV data downloaded. help. Thanks, CODE…
mmk88
  • 91
  • 1
  • 6