Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to store the column-value pair fetched from an excel to a collection?  RSS feed

 
antsi klando
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an excel sheet and I wanted to fetch the column and the corresponding value from the sheet.
how will I store the fetched column-value pair in a collection?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
antsi klando wrote:I have an excel sheet and I wanted to fetch the column and the corresponding value from the sheet.
how will I store the fetched column-value pair in a collection?

Is this the same topic as your last one, found here: http://www.coderanch.com/t/617033/java/java/Map-elements-Map-List-String

Does this mean you intend to abandon that other topic?
 
Stuart A. Burkett
Ranch Hand
Posts: 679
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Based on the limited amount of information you have supplied I would say you need to create a class that has fields to represent the column and the value. You then create instances of this class and add them to your collection.

A couple of things to consider spring to mind
1. Wouldn't a column have more than one value in it ? How are you going to handle this ?
2. How will you need to access the values after you have created them ? The answer to this will point you towards what sort of collection to use.
 
manish ghildiyal
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...may be you can use Map....key can be instance of class which has member variables for row,column index.

Manish
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!