无法解压缩python中的大斑点

时间:2018-08-19 23:48:33

标签: python html blob rtf

我一直在尝试使用python从Oracle提取压缩的blob并将其解压缩。但是较大的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()

另外,如果我将它们放在下面的数据帧中,这也是关于结构和内存使用情况的信息,其中is_blob是blob字段。 enter image description here

0 个答案:

没有答案