Hylafax Mailing List Archives
|
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
Re: [hylafax-users] send large group of unique faxes
I did figure out a way to do this.
I used two perl scripts, one to split the large source file which was an
ascii based file generated by a mail merge in word and the second kindly
provided by Bill Binko to generate the sendfax command and que up the
faxes.
The problem was that all 900 faxes were unique and being sent to 900
different people
In regards to using samba, i use smbfax
http://inconnu.isu.edu/~ink/new/projects/smbfax/ which i have found to be
more flexible than sambafax. (no flames nec, this is only my opinion)
So that everyone can benefit should they ever come into this situation here
are the two scripts;
############ begin script 1 ######################
#Split the master txt file into seperate faxes;
#!/usr/bin/perl -w
# open the big file
# rename to whatever you file is...
open(BIG, "./bigfile.txt") || die $!;
# create a directory to write all these individual letters into, so not to
make a mess locally
my $dir = "./tmp.letter";
if(! -d $dir){
mkdir($dir, 0755);
}
# write letters, named by numbers, containing from the date to the telnum
inclusive
my $counter = 1;
while(<BIG>){
chomp;
if(/^January|^February|^March|^April|^May|^June|^July|^August|^September|^October|^November|^December/i)
open(SMALL, ">$counter") || die $!;
print SMALL $_,"\n";
} elsif(/^Fax/){
print SMALL $_,"\n";
close(SMALL);
$counter++;
} else {
# only write to an open filehandle
# this accounts for the space between message end and new open
if(-e SMALL){
print SMALL $_,"\n";
}
}
}
######## End script 1 ###########################
######### begin script 2 #######################
#!/usr/bin/perl
#
# launchfax.pl
# Launces sendfax for each fax number in a list of files. (Sends the text
file that the fax
# number was found in to sendfax).
# usage: launchfax.pl { inputfile }+
# input files must have one or more fax number preceded by "Fax:"
#
$regexp = 'Fax:\s*(\+?1?\ *\-?\(?\ *\d{3}\ *\-?\)?\ *\(?\ *\d{3}\ *\-?\)?
\(?\ *\d{4})';
while (<>) {
while (/$regexp/g)
{
# remove the "echo" from the following line to make it work once it's
tested
system "echo sendfax -D -d $1 $ARGV";
}
}
######## End script 2 ###########################
_______________________________________________________________________________________________
mwestern@sola.
com.au To: sherd@muscletech.com, hylafax-users@hylafax.org
cc:
06/16/2003 Subject: RE: [hylafax-users] send large group of unique faxes
12:06 AM
not sure if you've figured this out, but sounds like you need broadcast
faxing? http://www.purpel3.com/sambafax/ is pretty good. i also found
some other guy that modified it a bit and added broadcast faxing...
http://www.qualico.ca/sambafax.htm which ideas i took and made a
speeddial
version...
or are you 900 recipients going to be different for every user?
regards
M
-----Original Message-----
From: Stuart Herd [mailto:sherd@muscletech.com]
Sent: Thursday, June 12, 2003 1:12 AM
To: hylafax-users@hylafax.org
Subject: [hylafax-users] send large group of unique faxes
Hi all,
I have been asked to figure out how to send 900 unique text based letters
to 900 unique recipients.
The letters are form letters with the address and fax # of the recipient in
the body.
All fax numbers in the letters start with 1- so i could parse the text for
the number and use that to create the sendfax command string.
Unfortunately my scripting is just not up to this and i was hoping someone
would be able to point me in the right direction.....
Can anyone help me out please?
Cheers,
Stuart
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null
*To learn about commercial HylaFAX(tm) support, mail sales@hylafax.org.*
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@hylafax.org < /dev/null
*To learn about commercial HylaFAX(tm) support, mail sales@hylafax.org.*