I have a function converts csv to excel. While converting csv to excel python script got failed due to below issue
Error: _csv.Error: line contains NULL byte
I have referred a link from stack overflow ("Line contains NULL byte" in CSV reader (Python)) and i found below solution
def fix_nulls(s):
for line in s:
yield line.replace('\0', ' ')
r = csv.reader(fix_nulls(open(...)))
Can any one help me what "YIELD" function will do ..
\0 is meant for nulls and nulls are getting replaced with space.
But i am not sure what is "YIELD" function will do.. Is this a better solution or any other suggestions.