This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

reading excel xlsx files to convert into CSV format  RSS feed

 
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am trying to read excel (xlsx) fiels using apache POI, I got one example from internet but it is not working. I am bot able to find issue code. Can any one check this code and let me know what is the issue and where i have modify code.
I m agettign nullpointer error in process method.
 
Sheriff
Posts: 21603
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the exception stack trace.
 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Error details,
 
Rob Spoor
Sheriff
Posts: 21603
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Reshma Reddy wrote:
Error details,


The error is not coming from XLSX2CSV.process but from XSSFReader.SheetIterator.hasNext. Can you show us the code for that nested class? Please also indicate which line of that class is line 207 in the source file.
 
Marshal
Posts: 62871
203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That question is too difficult for “beginning”, so I have moved it.
 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob,

I made a mistake in XLSX2CSV class, I was refering my local XSSFReader class which is wrong. I have modified code to refer org.apache.poi.xssf.eventusermodel.XSSFReader class, now it is workign fine. I am able to read xlsx files.
But it is taking around 10 mins time to read around 50 mb file, can you tell me in which part of code I can refactor to reduce processing time.

Thanks.
 
It's a pleasure to see superheros taking such an interest in science. And this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!