0

Hi guys,

My university recently switched mail services and in order to maintain our new listservs we have to import the emails using a different format. I have all the emails in a text file like this:

test@testing.com
test2@testing.com
test3@testing.com

In order to import it to the new mailing system it has to be in this format:

<test@testing.com> ""
<test2@testing.com>""
<test3@test.com>""

since there are lot of records I don't want to go through and edit each individually. I can import the text file, but just cannot add the characters to the list, I have tried li.append, but can't figure out why it will not work. Any help would be greatly appreciated!

thanks!

2
Contributors
2
Replies
5
Views
5 Years
Discussion Span
Last Post by bcarancibia
0

Hi there,
Welcome to daniweb. Please post down the code that you have written :). So that we could explore upon whats going on :).

0

oh oops my mistake.

this is what I have so far:

import sys

def maillist(file1):
    f1 = (openfile1)
    """Return new standardized email list"""
    new_list = []
    for value in f1:
        new_email = "<"+value[0:]+">"+"''"
        new_list.append(new_email)
    return new_list

f1 = (openfile1)
print (f1)
f1 = maillist(f1)
print (f1)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.