How do I convert CSV to hash map files?

Asked By 50 points N/A Posted on -
qa-featured

Hello,

I have some CSV files and I want to convert it to hash map files. However, I have no idea about this convert. How do I convert CSV files to hash map files?

Regards

Dallas Corey

SHARE
Answered By 0 points N/A #137809

How do I convert CSV to hash map files?

qa-featured

Hi, If it is comma-delimited name and value pair on each line, wrap your file stream with a    BufferedReader, loop on readLine(). To split the String into a name-value side you’ll need to search the string for the location of the comma and use that to call substring() and You might also want to trim() to make sure you've removed white space.

      You can also basically loop through the CSV file and input the data using a comma delimiter. And that will give you each piece of data by itself, and then you would just put that into the hashmap.

Hope this will help you.

Good Day!

Login/Register to Answer

Related Questions