| Author |
Message |
pimpoff New Member


Joined: Sep 25, 2003 Posts: 21
|
Posted:
Sun Feb 01, 2004 9:02 pm |
|
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. |
|
|
|
 |
Raven Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Sun Feb 01, 2004 9:13 pm |
|
That would be very easy to do. See this for some background.
|
|
|
|
 |
pimpoff New Member


Joined: Sep 25, 2003 Posts: 21
|
Posted:
Mon Feb 02, 2004 12:36 am |
|
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 Site Admin/Owner

Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
|
Posted:
Mon Feb 02, 2004 6:07 am |
|
Something like this should work | Code: | | LOAD DATA INFILE 'data.txt' INTO TABLE table2 FIELDS TERMINATED BY ' '; |
|
|
|
|
 |
pimpoff New Member


Joined: Sep 25, 2003 Posts: 21
|
Posted:
Mon Feb 02, 2004 10:37 pm |
|
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. |
|
|
|
 |
|
|
|
|