Getting parseFloat to take things like "$1.0054e+10"

Hi,
I need to read in an excel file, some of the columns of which should be floating point numbers. The problem is that the format of the data in these columns can't be guaranteed, I may or may not get $ signs, I might get the 'e' exponential thing, I might even get commas in place of decimal points (as is done in Spanish).
Any suggestions on the best way to handle this? I guess I could start by checking each char in the string, and eliminate it if its ascii code falls outside the 0-9 range, and is not 'e' or ',' or '.'. But how on earth can I handle exponentials, and commas in place of points?
Thanks all

Rather than creating a new number parser from scratch look at the parsing abilities of DecimalFormat class and BigDecimal constructor BigDecimal(String val).
While you may still need to cleanup the input, these can probably reduce the amount of work required, as they both accept widely varied number formats.

Similar Messages

  • I restored my iPod in the middle of a download, now it can't do anything but restore, and when i restore it, the screen gets stuck on weird things, like the apple screen or purple or yellow. how do i get it un-stuck?

    i restored my iPod in the middle of a download, now it can't do anything but restore, and when i restore it, the screen gets stuck on weird things, like the apple screen or purple or yellow. how do i get it un-stuck?

    Try:
    - iOS: Not responding or does not turn on
    - If not successful and you can't fully turn the iPod fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • Im using a Macbook Pro, running a Mac OS 10.6.8, with 400GB  free of space and it is running slow. It takes 10 minutes to start up and things like that. What should I do?

    Im using a Macbook Pro, running a Mac OS 10.6.8, with 400GB  free of space and it is running slow. It takes more than 15 minutes to start up and things like that. I cant seem to do anything as it is so slow. The 'beachball of death' is also present during start up. What should I do? Please help

    Try these two steps first. 
    Get the Original Installation disk and boot the MBP holding down the C key.  When you get to the point where you see a menu bar on the top of the display, select UTILITIES.  From the drop down menu select DISK UTILITY>FIRST AID.  Run verify and repair.
    See if there is any improvement.
    Try a Safe Boot:
    http://support.apple.com/kb/HT1455
    This might indicate that third party applications are an issue.
    Ciao.

  • How can I get apple to email me things like updates and stuff like that on email?

    How can I get apple to email me things like updates and stuff like that on email?

    You can't.

  • TS4062 On my Iphone I have 1-Camera roll, two Photo Libraries, and 1 delete.  I cannot get rid of the Photo albums off the phone.  I cannot take things off my Iphone using the itunes because it doesn't pull the Iphone up.

    On my Iphone I have 1-Camera roll, two Photo Libraries, and 1 delete.  I cannot get rid of the Photo albums off the phone.  I cannot take things off my Iphone using the itunes because it doesn't pull the Iphone up.

    Pat2006 wrote:
    I cannot take things off my Iphone using the itunes because it doesn't pull the Iphone up.
    Correct. You don't use iTunes to get photos off the iPhone.
    See this -> http://support.apple.com/kb/HT4083

  • When I compose and send a mail, it gets placed in Outbox and I get a prompt stating something like "relating the message is not supported". Even if I compose a newest age, it says the vey same thing. I just cannot send any response through my mail account

    When I compose and send a mail, it gets placed in Outbox and I get a prompt stating something like "relating the message is not supported". Even if I compose a newest age, it says the vey same thing. I just cannot send any response through my mail account. Can anyone help with a solution?

    You haven't set up the SMTP (outgoing) mail server correctly. You probably didn't enter your user ID and password for the outgoing server. They are needed even though it says "optional".

  • I accidentally saved a URL using Chrome and I'd like to delete it from the iPad. I reset privacy settings in Chrome, but it shows up in Mail, Notes, etc. How do I get rid of this thing? Thanks.

    I accidentally saved a URL using Chrome and I'd like to delete it from the iPad. I reset privacy settings in Chrome, but it shows up in Mail, Notes, etc. How do I get rid of this thing? Thanks.

    it's only possible with pop3 type email accounts not with imap and exchange
    preference->account->click the account in question-Click advanced and set "remove copy from server after retreiving a message to what you wish it to be

  • TS3694 I tried to get rid of my jailbreak things like restoring my whole phone. It didn't work. Now it keeps showing the photo to connect to itunes so I did. It said to restore so I did. and it keeps doing the same thing over and over and over and over ag

    I tried to get rid of my jailbreak things like restoring my whole phone. It didn't work. Now it keeps showing the photo to connect to itunes so I did. It said to restore so I did. and it keeps doing the same thing over and over and over and over again. How do I fix it?

    Your phone is toast.  Contrary to what the lovely folks in the jalibreaking community say, attempting to restore the iPhone to "factory" condition does not always remove the jailbreak.  You'll need to contact those bozos and see if they can help you.
    Hint:  start saving for a new phone.

  • If i have a shattered ipod touch 4th ggeneration and i trade it in at Apple Store for the ipod touch 5th generation Will they take it even though it is shattered? and will  i get my 10% recycling thing?

    If i have a shattered ipod touch 4th ggeneration and i trade it in at Apple Store for the ipod touch 5th generation Will they take it even though it is shattered? and will  i get my 10% recycling thing?

    As far as recycling, they will take one, dead or alive, so I assume a shattered one would qualify just as well.

  • Why does my Macbook Pro get extremely hot doing simple things like surfing the web?

    I have a mid 2010 Macbook Pro. 4GB of ram 500GB HD. The last few months my mac has been getting extremely hot when I do simple things like listening to music or going on facebook etc. I have used accessories to cool it down, but it doesnt seem to work. Any suggestions on what I should do?

    Might be that the vents are clogged and need a clean up. Depends on the environment it was used in (dust, smoke, etc).
    Might also be that some piece of software is the culprit and not iTunes or Safari/Chrome/Firefox.
    Run Activity Monitor and see which application(s) use abnormally high amount of processing power.

  • Just updated to Lion.  Didn't realize things like reading a Word document would not be supported.  How do I get these files back and how I do read them going forward?  When a PC user sends me a word document won't I be able to open it and read it?

    Just updated to Lion today, 11/22/11.  I did not realize things likes reading a Word document would not be supported.  "You cannot open this because PowerPC applications are no longer supported."  How am I supposed to read and open Word documents from PC users?  Any insight is helpful, thanks!

    You have Word 2004 which is PPC based. Lion is not able to execute PPC code. You have to upgrade. Or you can do as I do an open them in Pages, since I refuse to allow anything from Microsloth on my Mac.
    Allan

  • My computer will not let me click on certain things, like toolbars in different programs.

    Recently my computer started acting up. It will not let me click on certain buttons as well as my URL bar in Chrome, nor things like my toolbars in some Adobe Products, but not all of them. I don't know of any changes that have been made on the computer,
    so it seems to just have started from no where. If I click around enough, it will fix itself, but it takes a while. I've rebooted numerous times and reinstalled my browser - even though the issue stems across multiple programs - to no success. 
    Also, upon restarting my computer, my menu bar at the bottom stays hidden until I ctrl+alt+del and bring up the task manager.
    Any ideas on what the problem could be?
    Thanks in advance!
    Mike

    Hi txMMiller,
    This issue doesn’t seem like a system problem.
    Please change another mouse and PS2/USB port for good measure.
    It’s also could be caused by the information in the CMOS getting corrupted, Check your motherboard manually for the position of the CMOS reset jumpers. Or you can unplug the power to your system and remove the CMOS battery for a few minutes.
    Note: Remember to go into your bios afterwards and recheck all your settings. Don't forget to set the proper date and time there too. Otherwise you could run into some problems with windows when the date and time are behind that of the time
    stamp on many of your files.
    Regards
    D. Wu
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • HT3964 MacBook 2007 won't start up all of the way it gets the loading circle thing then it just keeps going and a bar thing pops up to load but doesn't and about a few minutes and it shut off. I don't have a disk for the computer or another Mac so what do

    need help MacBook 2007 won't start up all of the way it gets the loading circle thing then it just keeps going and a bar thing pops up to load but doesn't and about a few minutes and it shut off. I don't have a disk for the computer or another Mac so what do I do?

    I don't have the disk and i tried the shift key and it didn't do anything, i have tried like everything but it won't work and i was givin this computer with a charger and that is all nothing came with it and i don't think that it had the lion thing on it either i never got to that it just won't turn on and i have another mac that was a family members but it won't turn on either at all it won't load anything the screen stays black. so i don't really know at all what to do is there anything else? i don't want to take it anywhere because i have no money for that, and i need this computer for school. Any sugestions?

  • Trying to get dll calls to work like c++

    Hi,
    I understand there have been many posts about dll files.  I have reviewed them and found nothing that helps me.  I have a segment of c++ code that communicates with a digital correlator, reading data from it.  The c++ code works fine, but when I wrote the code in Labview, I get results that are reasonable sometimes....sometimes I get good data, sometimes odd data, and sometimes no data.  The c++ code ALWAYS yields good data.  The function prototypes in each of the call library functions matches that in the c++ code. 
    The C++ code is attached.
    NOTE THAT there are a few things (like calculating delay times and writing to file I don't do in the labview code).
    The labview code never outputs any values in TraceA or TraceB, which should be values around 300,000.  The DLL location is set correctly, as evidenced by the fact that the code works....just not consistently.
    Any help would be greatly appreciated.
    Josh
    Attachments:
    Correlator.vi ‏38 KB
    sample.cpp ‏6 KB

    Your message is very clear!
    I have no idea how the fact that this particular code was made to work would help you unless you try to use the same DLL which would seem rather strange. As to what the OP posters problem was:
    One has to provide buffers to DLL functions for ALL parameters when one calls them. Yes LabVIEW does take care about buffer allocations everywhere else so you don't have to worry about that, but when calling C code, LabVIEW can't even guess what buffers the function may need. And therefore it correctly doesn't try to guess at all.
    Those arrays that the function should write into, have to be allocated BEFORE one calls the function. It's the single most problem why DLL calls don't work as expected either returning rubbish or crashing. And anyone claiming to have read all the posts about DLL calling on this board or also on lavag.org should have gotten across at least two dozen messages from me where I pointed that out and explained it in detail.
    in detail: The graph arrays do get initialized but in the same frame all control get initialized to default. That is completely wrong! one does either one or the other but not both and definitly not in the same frame because of uncertainety which is executed first.
    nTrace is initialized to 0 and then used as indication in the CallLibrary Node, how large the array needs to be. Well a 0 element array is just that an array of no content, therefore a buffer that can hold no information and therefore it's sheer unluck that the Call Library Node doesn't crash.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • HT1222 How do I increase the total amount of space I have on iPhone for things like iTunes n more music n like MusicTube n YouTube. Thank you in advance for any help that can be given.

    I am running out of usage space. How do I increase the total amount of space I have on my iPhone4S: for things like programs & apps such as, iTunes & more music & like MusicTube & YouTube. The only reason I have any space now is because the music that I had downloaded and synced onto my phone from iTunes I had to take it all off. I would really really love to be able to put my music back onto my iPhone. Currently I'm using apps like Spotify, AOLradio, and MusicTube to listen to music. Thank you so very much in advance for any help that may be given!

    Also to add to my original question: is what I'm asking even a possibility??? Meaning is there even a way to get more usage space? Or do I have to just continue to work within the confines that apple has preset on the phone?

Maybe you are looking for

  • I am unable to open more then 15mb file in autocad aw how to do it

    while i am downloaded a drawing about 28 mb on my ipad 2 3g+wifi 64 gb when i try to open in autocad Aw the error the file can not open above 15 mb please give a solution

  • Sharing Itunes store account

    I recently received a gift card for the itunes store and have tried to share it with my daughter, but it's not clear how to do this. Do we simply log into the same account from different computers to buy songs? If so, are those songs playable on both

  • How do I get built in apps like the App Store back

    How do I get built in apps like the App Store back

  • Installing Windows Vista Ultimate 64 bit on Bootcamp issue

    Hi I'm a newbie, I would like to install Windows Vista Ultimate 64 bit using boot camp. I went into boot camp to partition and split the 1 terabyte hardrive. half is for Leopard, the other half is for Windows Vista. I followed the steps and popped in

  • Include all sub-directories and files?

    I did search, so don't complain that this has been asked a billion times. I am using Automator to replace text for files and folders. But this only works with the files and or folders I select, it doesn't do it with the sub-directories and sub-files.