opencsv

114 Recommendations
1,274 Downloads (This Week)
Last Update:
Download opencsv-2.3-src-with-libs.tar.gz
Browse All Files

Description

A Simple CSV Parser for Java under a commercial-friendly Apache 2.0 license

opencsv Web Site

Categories

Data Formats

License

Apache License V2.0

Update Notifications





User Ratings

 
 
114
12
Write a Review

User Reviews

  • Posted by Ansury 2012-02-19

    Nice little library, but I really wish quotes weren't mandatory in the writer. Until that's resolved I just can't use this. The Javadoc is a bit confusing, I guess it is out of sync with the current release, since it shows boolean flags to address that in writeNext() which don't appear to be available in the current release (2.3 I think). I'd also prefer a CSVWriter constructor argument flag to disable quotes for all calls to writeNext() rather than having to specify the preference on every write. IMO the "typical" case would not require quotes for every single value. Another nice thing (haven't thought about how it'd be implemented) would be a way to specify an auto-quote preference on specific columns. I will check the repo to see if there's a newer version which addresses some of this, but until some of these are addressed in the convenient release download I'm afraid I have to give this a "- 1/2" rounded down to -1. Will update with a new review if the quote issue gets fixed...

  • Posted by Arun 2011-12-02

    Got a Error while trying to use CSVtoBean class Caused by: java.lang.NullPointerException at au.com.bytecode.opencsv.bean.HeaderColumnNameMappingStrategy.createBean(Unknown Source) at au.com.bytecode.opencsv.bean.CsvToBean.processLine(Unknown Source) ... 2 more Testing Code: import java.io.FileNotFoundException; import java.io.FileReader; import java.util.List; import au.com.bytecode.opencsv.CSVReader; import au.com.bytecode.opencsv.bean.ColumnPositionMappingStrategy; import au.com.bytecode.opencsv.bean.CsvToBean; public class OpenCSVTest { /** * @param args * @throws FileNotFoundException */ public static void main(String[] args) throws FileNotFoundException { /* Offer is a simple POJO class */ ColumnPositionMappingStrategy<Offer> colStrt = new ColumnPositionMappingStrategy<Offer>(); CsvToBean<Offer> c2b = new CsvToBean<Offer>(); CSVReader reader = new CSVReader(new FileReader("C:/offer.csv")); List<Offer> offerList = c2b.parse(colStrt, reader); for (Offer offer: offerList) { System.out.println(offer.toString()); } } }

  • Posted by greg 2013-01-21

    Nice project! You did a great job. Thank you!

Read more reviews

Additional Project Details

Intended Audience

Developers

Programming Language

Java

Registered

2005-09-21

Icons must be PNG, GIF, or JPEG and less than 1 MiB in size. They will be displayed as 48x48 images.