PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
pimpoff
New Member
New Member


Joined: Sep 25, 2003
Posts: 21

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

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: 16987
Location: Kansas

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

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 to the forums!
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
pimpoff
New Member
New Member


Joined: Sep 25, 2003
Posts: 21

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

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.
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16987
Location: Kansas

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

Something like this should work
Code:
LOAD DATA INFILE 'data.txt' INTO TABLE table2 FIELDS TERMINATED BY ' ';
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
pimpoff
New Member
New Member


Joined: Sep 25, 2003
Posts: 21

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

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.
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum