A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Read CSV in a map
Joined: May 11, 2010
May 12, 2010 00:04:20
I have a CSV file as below
VALUE 1A , VALUE 1B
VALUE 2A , VALUE 2B
VALUE 3A , VALUE 3B
i need to store the values in a map as a key value pair, map<VALUE1A , VALUE1B>so on, so that i can process it further.
Can someone please help me how to do it. I end up inserting same values as both the key and value.
If someone can provide a code snippet it would be really helpful
Joined: Mar 22, 2005
May 12, 2010 00:06:05
Instead of implementing your own CSV parser (which isn't quite as trivial as it seems at first), I'd use one of the existing libraries; see
for links to some of them.
Ping & DNS, my free Android app for network diagnostics
subject: Read CSV in a map
null values in hash map
Question regarding Map interface
Check if Map contains an array as an entry value
Sorting values of a Map.
summing values with the same key
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013