This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Rust Web Development and have Bastian Gruber on-line!
See this thread for details.
Win a copy of Rust Web Development this week in the Other Languages 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

reading microsoft excel sheet file

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how can i read a perticular excel sheet,

scenario is like this


i have rows and columns , i need read the column data using column heading and contents in the row using row heading.

example we have a column with the name Fruits as heading and data in that is apple, banana, grape like that

Fruits
apple
banana
grape

and in a row

vehicles : car , bike, truck

like this.

i already using api of poi
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;


sheet.getPhysicalNumberOfRows()
gives number of rows
row.getPhysicalNumberOfCells()
gives number of columns

and iteration also i dont want

i want any method or logic which points the required column or row directly or randomly but not sequentionally.

thanks for the help .
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

You can't access cells directly - you always need to go through the row object. Is that what you're asking?

I'll move this post to the Other Open Source Projects forum, where POI is discussed.
 
swati chowdary
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can i access a row randomly and directly , using the heading, not by looping and iterations, or passing the index,

and want to access through row heading.
 
Ulf Dittmer
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "randomly and directly"? Using an index is what is generally called "random access", and it's a rather direct access method.

Also, what is a "row header"?

And lastly, what problems do you see when using iterators or indexes that you're trying to work around?
 
swati chowdary
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the row position may chenge each time in the excel sheet ,i dont know the rows index every time the file chenges.
 
Ulf Dittmer
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see. If you make the cell a "named range", you can access it as described in the POI documentation: http://poi.apache.org/hssf/quick-guide.html#NamedRanges
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic