我一直在尝试使用python从Oracle中提取压缩的blob并将其解压缩。但较大的水滴并没有完全减压。在
我尝试过使用数据帧和文件来存储blob,然后解压缩它们,但是它不能转换更大的blob。记忆是可能的问题吗?我可以尝试哪些改变?在
我不能共享这些blob作为它的受限数据。我没有权限创建测试数据。在
我使用下面的git解压代码进行解压,这对较小的blob非常有效
https://github.com/joeatwork/python-lzw/blob/master/lzw/init.py
下面是我的示例代码:
sql_string = """select
event_id
,blob_length
,blob field
from table"""
cur.execute(sql_string)
path = "P:/Folders/"
for row in cur:
print('de-BLOBbing {}..\n')
filename = path + "clinical_notes_" + str(row[0]) + "_" + str(row[1]) + ".txt"
filename1 = path1 + "clinical_notes_" + str(row[0]) + "_" + str(row[1]) + ".txt"
f = open(filename, "wb")
f.write(row[3].read())
f.close()
h = html2text.HTML2Text()
h.ignore_links=True
blobbytes = row[3].read()
f2 = h.handle(striprtf(decompress_without_eoi(blobbytes)))
f1 = codecs.open(filename1, encoding='utf-8', mode='wb+')
f1.write(f2)
f1.close()
目前没有回答
相关问题 更多 >
编程相关推荐