Need a script to parse data from .txt file to MySQL

Discussion in 'MySQL' started by NITRO23456, Nov 3, 2009.

Thread Status:
Not open for further replies.
  1. #1
    Hi

    I need someone who can write a script where the user browses for a .txt file on their harddrive and the script will pass some of the data to a MySQL database. I say some of the data as I would need some of it ignored.

    Ideally, I would want this data displayed in an input form before the user clicks submit to send it to the database.

    sample of the text file:

    
    Itemnumber      Serial-/Lotnumber       ordered    to follow      shipped
    --------------------------------------------------------------------------------
    7D5420          123456789                 4.000         .000        4.000
                    ITEM 1
                    Expiry date        : 2010/04/13
    --------------------------------------------------------------------------------
    7D5520          987654321                 1.000         .000        1.000
                    ITEM 2
                    Expiry date        : 2010/05/15
    --------------------------------------------------------------------------------
    7D5620          ABCDEFGHI                 3.000         .000        3.000
                    ITEM 3
                    Expiry date        : 2010/06/11
    --------------------------------------------------------------------------------
    7D5830          QWERTYUI                 2.000         .000        2.000
                    ITEM 4
                    Expiry date        : 2011/06/15
    --------------------------------------------------------------------------------
    6K3901          ZXCVBNNM                 6.000         .000        6.000
                    ITEM 5
                    Expiry date        : 2010/09/03
    -------------------------------------------------------------------------------- 
    
    Code (markup):
    I want the item name, lot number, expiry date and quantity shipped to be pulled and all the rest ignored. Sometimes this txt file will be for 200+ items.

    I can only pay $20 for this.
     
    NITRO23456, Nov 3, 2009 IP
  2. FCM

    FCM Well-Known Member

    Messages:
    669
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    155
    #2
    Converting basic text ( such as you have ) would be extremly hard... You should convert your text to INSERT statements that work with SQL. You can even see an example by going to the W3schools.com website and clicking on SQL and viewing the tutorials. 20 would only cover me writting code for 20 mins.
     
    FCM, Nov 3, 2009 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    You need a custom parsing application. You could use php or another scripting language for this. It may cost more than $20 to get someone to do this.
     
    jestep, Nov 3, 2009 IP
  4. n3r0x

    n3r0x Well-Known Member

    Messages:
    257
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    120
    #4
    i can fix that for you.. just send me a pm
     
    n3r0x, Nov 7, 2009 IP
  5. n3r0x

    n3r0x Well-Known Member

    Messages:
    257
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    120
    #5
    Job done by me.. you can close the thread.. :D
     
    n3r0x, Nov 9, 2009 IP
Thread Status:
Not open for further replies.