You think to yourself, you can’t be the only one that has had to deal with this… and you’re right!

There are several packages that parse CSV files.

Apache Commons CSV This has the apache brand name and it seems pretty powerful, with the ability to parse multiple csv formats, including MS Excel CSV, MySQL CSV, RFC 4180 formatted CSV, and Tab-Delimited-Files. The first production version (1.0) was just released, but it has been in development sandbox for several years

OpenCSV This has been around for awhile and seems quite popular. It’s very simple to use, but there have been complaints that support is lacking and you often get no responses from the authors. After a 3-year hiatus, the team finally released a new version (3.0) possibly in response to the recent official release of Apache Commons CSV

JSefa This is an annotation-based CSV parser. Consider this if you have well-structured CSV’s that you’re parsing. You simply annotate a POJO class and it parses and populates the contents of the CSV file into a java object for you. How convenient!

All of the above are licensed under the Apache License V2.0, meaning they’re safe for academic, commercial, or recreational use.

I ultimately went with Apache Commons CSV because I’m a brand name whore and I’ve already accessorized so many of my projects with apache libraries, which hopefully means less clashing of fashion styles and classes.

If you decide to go with the Commons CSV and use maven to build your projects, simply add this dependency to your pom.xml