#@ Row 1, Column 4: Invalid character value for cast specification @#
BCC,01,12697,2013-12- 12,1.0,2014004,CR,ACCOUN TS PAYABLE,-86.23000,,2200-000-000,, ,,,,True,,0,False,,,False,,,,,,0.00000,0.00000
I am trying to remove the tab in the date value and elsewhere in each row of data.
columndata = [str(items.replace('\t', '')) for items in list(row)]
However, this command returns the following error:
File "apdetfac.py", line 60, in <listcomp>
columndata = [str(items.replace('\t', '')) for items in list(row)]
AttributeError: 'NoneType' object has no attribute 'replace'
I tried converting items to str as follows str(items) in list(row) but that generated another error. What to do?
[str(items.replace('\t', '')) if items else items for items in list(row)]Also, what is the row object? Is it 1 row of data? In that case you are not looping properly