getting info from database - i've tried and tried
hello:
i've got a database with 5 differ arrays(?) per line, like this:
name¦email¦phone¦state¦city
there's about 50+ lines with that unique individual info.
how would i go about pulling just the email from each line and putting the emails all on a text file like this:
[email protected]
[email protected]
[email protected]
and so on
thanks in advance
----------
My Site Got Hacked, Check It Out!
http://www.birminghamnet.com
Traffic-Website.com free traffic, affiliate programs, hosting, & domain names.
My Site got hacked, but i'm coming back?
Stefen Enns posted this at 22:07 — 15th October 1999.
He has: 150 posts
Joined: Apr 1999
This code should help you... I haven't tested it, but it should work
#!/usr/bin/perl
open (DB,"/path/to/the/database.whatever");
@database=<DB>;
close (DB);
open (EMAILFILE,">/path/to/the/email.file");
foreach $line (@database) {
($name,$email,$phone,$state,$city) = split(/\¦/,$line);
print EMAILFILE "$email\n";
}
close (EMAILFILE);
Stefen Enns posted this at 22:09 — 15th October 1999.
He has: 150 posts
Joined: Apr 1999
Ahh! Where'd the smiley faces come from??
Let's try this again...
#!/usr/bin/perl
open (DB,"/path/to/the/database.whatever" ) ;
@database=<DB>;
close (DB);
open (EMAILFILE,">/path/to/the/email.file" ) ;
foreach $line (@database) {
($name,$email,$phone,$state,$city) = split(/\¦/,$line);
print EMAILFILE "$email\n";
}
close (EMAILFILE);
fairhousing posted this at 20:45 — 16th October 1999.
They have: 1,587 posts
Joined: Mar 1999
looks good i'll have to try.
thanks a lot
----------
My Site Got Hacked, Check It Out!
http://www.birminghamnet.com
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.