Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Java (https://www.askmehelpdesk.com/forumdisplay.php?f=440)
-   -   Regular Expressions (https://www.askmehelpdesk.com/showthread.php?t=139610)

  • Oct 11, 2007, 10:18 AM
    jstrike
    Regular Expressions
    I use a program called The Regex Coach which usually allows me to hack out regex expressions but I'm having a tough time with this one.

    Here's the line... I have about 50-60K of these to parse in each file and 3 files total.

    Diesel,None,None,None,DTH,6,"00,111",4,No,0.92811, "33,321.00", YES ,"7,876","8,343",350,Sullivan,Yes/No,444,CAT C18,Caterpillar,30,0,6,4,30,HR,33,33HR

    The person that wrote the initial parser went through the line character by character and it takes forever to read the file in, I need to speed this up. I need a regular expression that will allow me to find the parts in the double qutoes so I can change them and properly split the line into an array. For the above line I would need to be able to find:
    "00,111"
    "33,321.00"
    "7,876"
    "8,343"
    Once I've found the string, changing it is trival... I just can't seem to figure out the regular expression.

    Any help is greatly apprecaited,
    -Jeff
  • Oct 11, 2007, 01:48 PM
    jstrike
    "\d+,{1}[\d.]*" appears to work. I got the answer just in time to have this project side tracked.

  • All times are GMT -7. The time now is 12:00 PM.