Re: Parsing for email addresses

2010-02-16 Thread galileo228
Tim - Thanks for this. I actually did intend to have to sift through other junk in the file, but then figured I could just cut and paste emails directly from the 'to' field, thus making life easier. Also, in this particular instance, the domain names were the same, and thus I was able to figure

Re: Parsing for email addresses

2010-02-16 Thread Tim Chase
galileo228 wrote: [code] fileHandle = open('/Users/Matt/Documents/python/results.txt','r') names = fileHandle.readlines() [/code] Now, the 'names' list has values looking like this: ['aa...@domain.com \n', 'bb...@domain.com\n', etc]. So I ran the following code: [code] for x in names: st_li

Re: Parsing for email addresses

2010-02-16 Thread galileo228
Hey all, thanks as always for the quick responses. I actually found a very simple way to do what I needed to do. In short, I needed to take an email which had a large number of addresses in the 'to' field, and place just the identifiers (everything to the left of @domain.com), in a python list. I

Re: Parsing for email addresses

2010-02-15 Thread Ben Finney
galileo228 writes: > I'm trying to write python code that will open a textfile and find the > email addresses inside it. I then want the code to take just the > characters to the left of the "@" symbol, and place them in a list. Email addresses can have more than one �...@’ character. In fact, t

Re: Parsing for email addresses

2010-02-15 Thread Tim Chase
Jonathan Gardner wrote: On Feb 15, 3:34 pm, galileo228 wrote: I'm trying to write python code that will open a textfile and find the email addresses inside it. I then want the code to take just the characters to the left of the "@" symbol, and place them in a list. (So if galileo...@gmail.com w

Re: Parsing for email addresses

2010-02-15 Thread Jonathan Gardner
On Feb 15, 3:34 pm, galileo228 wrote: > > I'm trying to write python code that will open a textfile and find the > email addresses inside it. I then want the code to take just the > characters to the left of the "@" symbol, and place them in a list. > (So if galileo...@gmail.com was in the file, '