This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Help in reading mobile number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Help in reading mobile number" Watch "Help in reading mobile number" New topic
Author

Help in reading mobile number

pooja prabhu
Ranch Hand

Joined: Sep 23, 2012
Posts: 33
hi

Can Anyone please tell me how to read mobile number example:9823145678 in java from excel

Thank you
James X Peterson
Whizlabs Java Support
Ranch Hand

Joined: Feb 26, 2013
Posts: 158
Hi Pooja,

if you know how to read a excel file then you can do it by giving a condition to read only mobile number column from excel file.

Regards,
James
pooja prabhu
Ranch Hand

Joined: Sep 23, 2012
Posts: 33
Thanks James
Actually i am new to java so can you elaborate?
Can You Tel Me how to do it..
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
What do you have so far, and where are you stuck making progress? If you haven't started, then you should get familiar with the Apache POI library for reading Excel files.


Ping & DNS - my free Android networking tools app
pooja prabhu
Ranch Hand

Joined: Sep 23, 2012
Posts: 33
yes i have already started
I take file name from text box
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
So what's still missing?
pooja prabhu
Ranch Hand

Joined: Sep 23, 2012
Posts: 33
i cant read correct mobile number. it saves 2147483647 instead of mobile number
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
You're treating the phone number as an integer, whereas you should be treating it as a string.
pooja prabhu
Ranch Hand

Joined: Sep 23, 2012
Posts: 33
i had tried it it gives me exception

java.lang.IllegalStateException: Cannot get a text value from a numeric cell
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
Then you need to change the spreadsheet so it doesn't format that field as a number. Phone numbers are strings, not numbers.
pooja prabhu
Ranch Hand

Joined: Sep 23, 2012
Posts: 33
what will be the format?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
Which options do you see? Which one do you think makes sense?
 
GeeCON Prague 2014
 
subject: Help in reading mobile number