This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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

 
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?
 
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?
 
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.
 
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!