如何用Python读取未知结构的.cdpg文件?解析数值异常求助
求助:Python解析LabVIEW生成的.cdpg文件失败
我尝试使用Python读取由LabVIEW代码生成的.cdpg文件,但无法获取该文件的结构信息。参考Stack Overflow的一篇帖子编写了代码,虽能运行但解析出的数值毫无意义,不确定是代码存在问题还是对数据的解读有误。
使用的代码如下:
import struct with open(file, mode='rb') as file: # b is important -> binary fileContent = file.read() ints = struct.unpack("i" * ((len(fileContent) -24) // 4), fileContent[20:-4]) print(ints)
我提供了测试文件cx0000000a.cdpg,恳请各位提供指导。
谢谢,
T
内容的提问来源于stack exchange,提问作者Tanjil
相关产品推荐
相关产品推荐

