SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Sep 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Extraction of data from textfile into mysql/php

    Hi,

    I'm a noobie in PHP/mySQL, and I'm still in a learning process. I have a textfile located on the desktop, and I want to extract the data from it and put these data into my database.
    My data in the code is in this format in the text file:

    2011/10/16 18:00
    Total sum: 60

    My objective is to put these data into my database table in "Date Time Sum"

    Anyone got any idea of a sample source code for this, thank you!!!

    Regards,
    Eugene

  2. #2
    SitePoint Member
    Join Date
    Sep 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm...it's a .txt file instead of a csv file unfortunately

  3. #3
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,508
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    If the data you want to extract is always in the same format, then take a look at http://www.php.net/manual/en/function.substr.php


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •