• 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:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to convert excel sheets exponential cell format to java string

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am facing a problem in importing excel sheet in java application and intern inserting rows in oracle database.
One columns in excel sheet is holding numeric value and data length of that particular column is 17 digits.
Excel automatically converting the value of that column in some format (seems exponential) i.e. 12345678901234500 becomes 1.23E+16.
I am parsing this excel file and fetching cells in string, So when i try to ready 12345678901234500 value i get 1.23E+16 and as it is its getting inserted in database.
Does anybody faced similar problem ever? How do I retain or reformat this value. I dont have control over excel sheet so i can't format as its coming by import process from client.

Any help is appreciated.
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds like the problem is with the source file. Can you ask the client why they have data stored in that way?
 
Vaibhav Naikwade
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Yes right,

Problem is with excel sheet. If I simply enter numeric value more than 10 to 12 digits without any cell formatting
it converts it some form. Its not a scientific notation, so i could not apply reverse formula as well.

Apache POI API would have helped me but I could not use that as well. It will make lots of classes to go in garbage and architectural changes.

 
Martijn Verburg
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's best off getting the problem solved in Excel, I assume you can change the properties of the cell in Excel so it can show the larger number correctly?
 
Let's go to the waterfront with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic