How To Do Just About Anything With CSV Files in Java
Ranked #98,496 in Computers & Electronics, #1,576,278 overall
The World's Most Evil Data File Format
Comma Separated Values. Easy. You just split on newlines and then on commas. Throw a StringTokenizer at it and you're done?
Hmm. It's not all about commas and newlines. Oh no. Excel likes you to quote any fields containing a comma or a newline. But then you can't just split the file on newlines! They might be quoted. Bummer.
And the same goes for commas. Might be quoted.
Not, an, easy, "file
format", to, work "with, eh?"
Really means:
[Not] [an] [easy] [file format] [to] [work] [with, eh?]
So what's a coder to do? Well luckily there's a whole bunch of components that can hande CSV for you.
Contents at a Glance
Java CSV Components
Note: these are not in any particular order.
- StelsCSV
- A CSV JDBC type 4 driver that allows you to perform SQL queries and other JDBC operations on CSV files. [Commercial]
- CSV Reader
- Fast and easy-to-use Java library. [Freeware]
- DBMT
- A Database migration tool that uses CSV. [Open Source: GPL]
- CsvJdbc
- A simple read-only JDBC driver that uses Comma Separated Value (CSV) files as database tables. [Open Source: LGPL]
- PZFileReader
- A flat file parser that handles CSV. [Open Source: Apache 2]
- CSV Objects
- Transparently parsing and unmarshalling CSV files and records into Plain Old Java Objects. [Open Source: GPL]
- Ostermiller CSV
- Utility for reading and writing CSV files. [Open Source: GPL]
- Ricebridge CSV Manager
- Handles high volume, very large CSV files. Data returned in multiple forms, including Arrays, Lists, Tables, ResultSets, and Java Beans (POJOs). [Commercial]
- xlSQL
- JDBC Driver for Excel and CSV data sources. [Open Source: GPL]
- Open CSV
- A very simple csv parser library. [Open Source Apache 2]
Disclaimer
As you may have noticed, I have a commercial CSV component in that list.
by rjrodger
Feeling creative?
Create a Lens!
Explore related pages
- Daily Deal Sites Like Groupon Daily Deal Sites Like Groupon
- Review & Compare: The No-Fee THRiVE Chequing Account from ING Direct Canada Review & Compare: The No-Fee THRiVE Chequing Account from ING Direct Canada
- The best K-cup coffee for your Keurig single cup coffee brewer The best K-cup coffee for your Keurig single cup coffee brewer
- Benefits of a Combi Boiler Benefits of a Combi Boiler
- Best Mobile Coupon iPhone Apps Review for Moms Best Mobile Coupon iPhone Apps Review for Moms
- Saving Water for Kids Saving Water for Kids