I am using Arcpy to load a table from Excel. One of the fields has a lot of text (up to 2000 characters) and when using arcpy.MakeTableView_management the field is given the type 'BLOB'. Is there any way to either prevent this from happening, i.e. making sure the field type is 'Text', or is there a way of reading the text in python so the data can be used?
I have read BLOB TYPE in Arcmap but it does not answer the question. I am specifically trying to read the data in Python, while the previous question referred to reading it in ArcMap.
1 Answer 1
from arcpy import da
import os
with da.SearchCursor(r"c:\temp\demo.gdb\table",['blobFieldname','fileName']) as cursor:
for row in cursor:
binaryRep = row[0]
fileName = row[1]
# save to disk
open(r"c:\saveFolder" + os.sep + fileName, 'wb').write(binaryRep.tobytes())
del row
del binaryRep
del fileName
rows = arcpy.da.SearchCursor("Table","Comments") for row in rows: memview = memoryview(row[0]) print memview[2]