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:
[['[email protected]'], ['[email protected]'], ['[email protected]'], ['[email protected]'], ['[email protected]'], ['[email protected]'], ['[email protected]'], ['[email protected]'], ['[email protected]'], ['[email protected]']]
>>>
But I need the results to appear only '[email protected]'
without the '[]'
, so I can validate them.
You can just
', '.join(ifile.read().splitlines())
, you get, "Email1, Email2, email3, ..."– Miguel