Can OpenCSV parse CSV files and return data in a list as attribute:value
Suhu Shah
Greenhorn
Joined: May 24, 2010
Posts: 2
posted
0
Hi folks,
I m new to this site and need some guidance in moving forward. We need a dynamic parser that will be working with a series of CVS files.. each having different fields and values.. however the format would be something like below..
"NAME","ADDRESS","CITY","STATE","POSTAL_CODE","CNTRY_CODE"
"NY-Correctional Facility","Exchange St","ATTICA","NY","14011","US
"
"Consolidated School Corp","205,East Street","Attica","IN","47918","US
"
Looking at OpenCSV it seems it can handle most of the data issues we have seen in CSV files, like comma inside values, carriage returns etc. However one of our requirements is that after parsing the CSV files I need the tool to return it as a list with the format attribute:value where attribute would be the corresponding field from the header line.
ie something like this..