Hi I have a csv file delimited by comma like this.
name, email1; Email2; email3, etc, telephone
I want to extract all the emails addresses from the email field using csv module in python. And from each email address write a row using the other fields like this
name, email1, etc, telephone
name, Email2, etc, telephone
name, email3, etc, telephone
Maybe I need to read the email field and split it in separated strings?
Create a CSV reader and writer, and as you said, read the file using the standard
,
separator, and then split the email field manually using;
. For each email entry, write the other fields:Or slightly more compact as:
Tested using Python 3.x