Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Other - Discussion
Author Message
pimpoff
New Member
New Member



Joined: Sep 25, 2003
Posts: 21

PostPosted: Sun Feb 01, 2004 9:02 pm Reply with quote

Hello,
I have like a search which searches almost 400 text files a few hundred lines each.

the text files consist of a name, and a number to the right of it seperated by a space. Would it be possible to import this into a mysql database for better searching? currently I use a form I made which runs cgi scripts and has diff search options. It uses bash commands to search aka grep.


And also would it be easy to make a good web interface to search the database ? with several options. I don't know much about mysql thats why I ask this.

My main concern is importing the text file data.
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Feb 01, 2004 9:13 pm Reply with quote

That would be very easy to do. See this for some background.
[ Only registered users can see links on this board! Get registered or login! ]
 
View user's profile Send private message
pimpoff







PostPosted: Mon Feb 02, 2004 12:36 am Reply with quote

Ok, I found a decent search script for now that seems to work only thing, is I am having problems importing the data because it is seperated by spaces. If i do a test file of same nature and seperate it by tabs it works fine. Any ideas how to use INFILE and have the diff fields seperated by a space.
 
Raven







PostPosted: Mon Feb 02, 2004 6:07 am Reply with quote

Something like this should work
Code:
LOAD DATA INFILE 'data.txt' INTO TABLE table2 FIELDS TERMINATED BY ' ';
 
pimpoff







PostPosted: Mon Feb 02, 2004 10:37 pm Reply with quote

I got it working last night Raven, i tried earlier what you said and it would like load it with alot of warnings and i noticed that only the name table would be filled and alot of the numbers in the numbers table was empty so what I did was, I used a sed command change multiple spaces just in case, to commas and when I loaded it into the 2 tables it seemed to work. Only thing im not sure about is is there a way to have another table with the date of the file, since I have like 350 files i think i would need a script.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Other - Discussion

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©