Welcome to WebmasterWorld Guest from 18.104.22.168
Forum Moderators: bakedjake
I'm moving my listserv into a new program. I need to add all my subscribers to the list.
I have a .txt file with one email per line. I want to loop through the file and add each address.
python jmlm.py -s firstname.lastname@example.org
How can I accomplish this?
Assuming that the file the addresses is in is called email_list, then this should work for you:
cat email_list ¦ xargs python jmlm.py -s
xargs executes commands based on input. Hopefully that works for you, let me know if you have any problems. Oh, and make sure to replace the ¦ with a real pipe (WebmasterWorld changes it).
A problem though, it only seems to add the first email address in the file.
The listserv script takes 1 email address at a time
python jmlm.py -s email@example.com
So how can I loop through each of the emails in the file and run them through the python script?