I have CAN-Data in the blf-format from the Vector software. For further investigation I want to convert it into csv format using python.
My progress so far:
List of that object does the trick
import can
import csv
filename = "test.blf"
log = can.BLFReader("test.blf")
log = list(log)
log_output = []
for msg in log:
msg = str(msg)
log_output.append([msg[18:26],msg[38:40],msg[40:42],msg[46],msg[62],msg[67:90]])
with open("output.csv", "w", newline='') as f:
writer = csv.writer(f,delimiter=';', quotechar='\"', quoting=csv.QUOTE_ALL)
writer.writerows(log_output)