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 Peterson
Whizlabs Java Support
Ranch Hand
Joined: Feb 26, 2013
Posts: 105
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
Whizlabs-Software , OCAJP 7 , SCJA 6 , SCJP 6 , OCPJP 7 , OCPJP 7- Upgrade ,SCWCD 5 ,OCEJWCD 6 ,SCBCD 5 ,SCEA 5 , PMP , PMI-ACP
Unconditional 100% Test PASS Guarantee!
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: 35258
posted Mar 07, 2013 02:51:59
0
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.
Android apps – ImageJ plugins – Java web charts
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: 35258
posted Mar 07, 2013 03:04:23
0
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: 35258
posted Mar 07, 2013 03:23:49
0
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: 35258
posted Mar 07, 2013 03:38:47
0
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: 35258
posted Mar 07, 2013 11:30:27
0
Which options do you see? Which one do you think makes sense?
subject: Help in reading mobile number