Gossamer Forum
Home : Products : Links 2.0 : Customization :

Program to access the data base.

Quote Reply
Program to access the data base.
Does any one have a or can recommend a way extract the user names and address in the links data base?


Maybe a short PL file to read and extract?

------------------
Thanks in Advance

Daniel J.
http://www.blackrose.net
webmaster@blackrose.net
Quote Reply
Re: Program to access the data base. In reply to
Sure,

# ---------------------------
while (<> ) {
chomp;
@data = split /\|/;
print $data[5], " ", $data[6], "\n";
}
# ---------------------------

then save it and run it like:

cat links.db | perl script.pl > email.db

or on Windows in Dos prompt:

type links.db | perl script.pl > email.db

That assumes the fields you want to extract ar in position 5 and 6 (remember: indexed from 0!).

Hope that helps,

Alex
Quote Reply
Re: Program to access the data base. In reply to
Thanks Alex, I am going to use this to take the e-mial address out and build the email.db and then send a message to let people know they are in it and can remove themselves from it if they wish.

I used it and it worked great.
I did make 2 small changes..

reversed the way the fields are written(if you are using standard Links the names and e-mail address are in the 7th and 6th fields and added a | to seperate them.

# ---------------------------
while (<> ) {
chomp;
@data = split /\|/;
print $data[7],"|", $data[6], "\n";
}
# ---------------------------


------------------
Thanks in Advance

Daniel J.
www.blackrose.net
webmaster@blackrose.net


[This message has been edited by SirDaniel (edited January 08, 1999).]

[This message has been edited by SirDaniel (edited January 08, 1999).]