CSV reader and skipping columns in a file that are not in my database

38 views
Skip to first unread message

Sphe Shoyisa

unread,
Nov 27, 2014, 4:03:37 AM11/27/14
to csv...@googlegroups.com
Hy I'm trying to read csv file and map them to the database using hibernate but now i cant read the header so i can map data to the correct column and ignore columns that are not in my database.please see the code attached to understand what I'm trying to say.
ReadHeaders.txt

shriop

unread,
Nov 27, 2014, 1:43:19 PM11/27/14
to csv...@googlegroups.com
Look at the methods getHeaderCount(), getHeader(int), and getIndex(string), http://javacsv.sourceforge.net/com/csvreader/CsvReader.html . You still have reader in scope, so you can still ask it which columns it found by what name at what index.

Bruce Dunwiddie
Reply all
Reply to author
Forward
0 new messages