2
I have a CSV (Excel) document with valid and invalid emails. And I wanted to take the values of the fields in the form of string, but the following code gives the return shown below:
import csv
import re
ifile = open('ead.csv', "r")
read = csv.reader(ifile, delimiter=' ', quotechar='|')
csvArray = []
for row in read :
csvArray.append(row)
print(csvArray[0:10])
Return:
[['naoinformado@naoinformado.com.br'], ['lucas.spereia@outlook.com'], ['ronaldo_123@hotmail.cm.br'], ['jessica_fonseca164@hotmail.com'], ['leidimara.vv@outlook.com.br'], ['patriciaazevedo@yahoo.com.br'], ['dallilass123@outlook.com'], ['michellybecker@hotmail.com.br'], ['mylena@campelo.com.br'], ['vitor@1257gmail.com.br']]
>>>
But I need the results to appear only 'email@test.com'
without the '[]'
, so I can validate them.
You can just
', '.join(ifile.read().splitlines())
, you get, "Email1, Email2, email3, ..."– Miguel