Python Forum

Full Version: change a text file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I have a text file that is full of emails. Their are many rows and columns of them.
I want to just have a list one email on a line. Can that be done with python.
I am using windows notepad and python 3.6.
The photo be low it what it looks like now.
I want to be able to have each one the the email on its own line.

[Image: email_test.png]

Shy I hope someone know how to do this.
Thank you
Renny
Is there no seperation between each eamil address?
ok thanks
(Aug-03-2020, 08:34 PM)Yoriz Wrote: [ -> ]Is there no seperation between each eamil address?

(Aug-03-2020, 09:12 PM)Blue Dog Wrote: [ -> ]ok thanks

Huh
Another way to put what Yoriz is asking: how do you tell when one address ends and the next begins? Also, do you really have more than one address in there? All the text looks the same to me..
I guess there are 0-bytes between the addresses or other control characters.
Just open the file in binary mode and read the first 20 bytes.
Then you'll see if there is a separator between the e-mail addresses or not.