View Full Version : Files & Database ???

07-13-2005, 02:39 PM
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 :confused: :eek: ?!.... Could you help me?

07-16-2005, 09:23 AM
I swear I posted a reply to this.

$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?

07-27-2005, 10:15 PM
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

07-29-2005, 06:19 PM
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.

07-29-2005, 06:52 PM
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.

07-29-2005, 07:38 PM
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.

07-29-2005, 07:50 PM
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 :(

07-29-2005, 08:15 PM
yeah you're right :), hopefully the rest of your day goes better.