我有一个.asc文件,我想将其转换为.blf作为每矢量格式。
我试过了,
from can.io import BLFWriter
import can
import pandas as pd
#input paths
path = '/home/ranjeet/Downloads/CAN/BLF_READER/input/'
asc_file = '20171209_1610_15017.asc'
blf_file = '20171209_1610_15017.blf'
df = pd.read_table(path + asc_file)
print(df)
字符串
我能够读取.asc,我如何将其写入.blf文件作为每矢量格式。
1条答案
按热度按时间c2e8gylq1#
如果已经在使用
python-can
模块,为什么还要用pandas阅读asc文件?您将分别在文档here和there中找到如何与asc和blf文件交互。
你应该注意的一件事是在二进制模式下读/写blf文件。所以在你的例子中,这应该是可行的(不要忘记停止日志,否则头会丢失):
字符串