Results 1 to 8 of 8

Thread: Files & Database ???

  1. #1
    Join Date
    Jul 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb Files & Database ???

    Hello!!
    Daily I receive a text file with certain information. I need to read it, process it and present it in a web site. The first thought I had was, read and process the information using C++ for example, since it was easy to do, and create a html file with the information I need it (It will be on tables). Then I thought that it would be great if I could process the information and write it into a database, since I could have just one dynamic web page, but I have no idea how to read a text file and write the information I need into the data base.

    Does anyone know how I could do such a thing?.. Maybe I could read a common text file using php, and then introduce the information into the database without using others tools, but It should be done once a day everyday (just once)…..

    I have no idea how could I do ?!.... Could you help me?

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I swear I posted a reply to this.
    PHP Code:
    $textfilecontent implode(file("file.txt"), "\n"); 
    The above line will get the content of file.txt and save it into $textfilecontent. Working with a database depends on the database software you have installed. More info?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It's ok! Thanks. I don't remember who answer the first time, but I needed the information so much that I make the same question several times in differents forum. Maybe you saw and answered before, but in another forum!
    Thanks anyway

  4. #4
    Join Date
    Jul 2005
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    well yeah that's a way to do it but it depends on how big the text file is then you might want to move to mysql for quickness.

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Quote Originally Posted by Willdawg
    well yeah that's a way to do it but it depends on how big the text file is then you might want to move to mysql for quickness.
    That has absolutely Billy-Bob relevance to the actual thread. S/he wants to put a text file into a database. I told her/him how to read the file, then asked for more info concerning the database so I could construct the database code. If I'm missing something, and you did in fact invent a way to magically transfer data from a file to a database using only MySQL, do let me know.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Jul 2005
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    bah Twey enough of your smartass comments haha. I know exactly what I'm talking about not in all instances but in this one. I know you use php to open and sort myql databases but I thought that was a universal understanding. I realize that the person wants it with a text file but I was trying to be of further assistance. Since, it's a lot slower loading from large text documents; I figured this person may not know that.

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    So why did you say s/he "might want to move to mysql?" S/he might even be using MySQL; no mention of the database software in question was made.

    Sorry for being a bit snappy... bad day
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Jul 2005
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yeah you're right , hopefully the rest of your day goes better.

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
  •