Skip to Content.
Sympa Menu

en - Re: [sympa-users] import large list in sympa

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Fil <address@concealed>
  • To: Anton Slabbinck <address@concealed>
  • Cc: address@concealed
  • Subject: Re: [sympa-users] import large list in sympa
  • Date: Fri, 26 Jan 2001 12:33:44 +0100

@ Anton Slabbinck (address@concealed) :
> Hi,
>
> I've installed sympa and created a list which stores it information in a
> database. Now I have a TXT file with 1200 email addresses I want to put in
> the list.
> What's the easiest (fastest) way to do this?


Having just done it for a bigbig list here's my advice:

1) parse your text file with a perl script in order to produce a file like
this

email address@concealed
gecos Jean
reception mail
visibility conceal

email address@concealed
gecos Valjean
reception mail
visibility conceal

and so on...


2) Then name your file "subscribers" and put it in

/home/sympa/expl/listname/


3) Configure your list as an "user_data_source file", start sympa

4) Then go to the wws interface and select

"user_data_source database"

the list will be uploaded. You're done.

-----------------------------------------------------------------------
For 1) if you don't want to perl your way through it sympa can do it for
you. But it's not very easy, trust me.

If your list is emails(spaces or tabs)(name), one subscriber by line, the
perl script would be something like

%%%%%%%%%%%%%%%%%%% BEGIN import_list.pl
#!/usr/bin/perl
$v=0;
$n=0;
while(<>){
$n++;
if (($email,$name) = /([^ ]+\@[^ ]+)\s*(.*)/){
$v++;
print "email $email\n";
print "gecos $name\n";
print "reception mail\nvisibility conceal\n\n";
}
}
print STDERR "Seen $v addresses in $n lines\n";
%%%%%%%%%%%%%%%%%%%

Then do
cat list.txt | ./import_list.pl > subscribers



Archive powered by MHonArc 2.6.19+.

Top of Page