Gossamer Forum
Quote Reply
list
I have got a list of url (more than 5000)from my friend and I want to put them in my search Engine
However ,it is a .txt file and the data are list like this:
URL
Site Title
Description
Folder
how can I convert the text to my links database?
thanks

Quote Reply
Re: list In reply to
Im not exactly sure this will work but how about making a cgi script to format it.....

open(FILE,"data.txt") || die "Can't open file:$!";
@data=<FILE>;
close(FILE);

($title,$url,$desc,$contactname,$contactemail)=split(/\n/,@data);

open(FILE,"links.db") || die "Can't open file:$!";
print FILE "$title|$url|$desc|$contactname|$contactemail\n";
close(FILE);

You need to add the delimiter for the additional fields at the end and the ID at the beginning.


(the txt file would need to be in that format with the title followed by url followed by description etc........)


This is by no means guaranteed to work and backup everything IF you try it....Im sure others will give some better ideas.

If you have 5000 then I think you are in trouble because from what you've shown, it doesnt seem like the txt file has all the necessary fields such as ID, Date, Contact Name etc.......you you will have to manually add them.....I wouldnt recommend trying to import data from other search directories that dont have the same structure as links.




Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: list In reply to
Thanks for your help.I am so happy after reading your reply post.
Howver ,I still have something I don't understand.
is it true that I can import data from other search directories that have the same structure as links?
If yes ,how to make it ?
Please help me.
Thank you

Quote Reply
Re: list In reply to
With Links SQL you can import from DMOZ.

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: list In reply to
????
SQL ???? DMOZ ????

Quote Reply
Re: list In reply to
Search the Links SQL forums...BTW: this thread is more appropriate in the Perl/CGI/SQL forum.

Regards,

Eliot Lee