Thursday, January 15, 2009

Parsing CSV File

I just wanted to read a simple CSV file in the resources folder and parse it in my spring application. A simple class to do the same. csvFileName is a string property injected at runtime.

CSV Reader

Errata: My good friend and colleague Ben has rightly pointed out availability of generic csv parsers that can make life easier. I am exploring Java CSV and Flatpack as suggested by Ben.

Java CSV Sample