1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Importing Data

Discussion in 'MySQL' started by Alexj17, Sep 22, 2008.

  1. #1
    Hey All

    I have been given a .txt file with 2.5 million rows. Each row has a number of different information such as date etc.

    Is there any way to extract just the date (first 10 characters on each row) and so i can import it into my database?

    Hope someone can help !

    Alex
     
    Alexj17, Sep 22, 2008 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    Personally, I would use something like navicat (http://www.navicat.com/) to import the text file into the db. Assuming that there is some sort of delimitation, you can select which data to import and what table / column to import in into. They offer a free persona version and a free 30 day trial of their commercial version. SOunds like this should do exactly what you need without having to strip down the text in the file.
     
    jestep, Sep 22, 2008 IP
    Alexj17 likes this.
  3. justinlorder

    justinlorder Peon

    Messages:
    4,160
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #3
    What is your database, mysql or mssql ?
    Is the txt well formed ?
    You must give indication before we can give any advices.
     
    justinlorder, Sep 22, 2008 IP
  4. Alexj17

    Alexj17 Member

    Messages:
    173
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #4
    will try that link now jestep thanks

    justinlorder - the text file is well formed, first 7 charchers are what i need and the 16-21 and 30-34 on every line.

    Database is mysql
     
    Alexj17, Sep 22, 2008 IP