How to export data to .dat file using mdfreader library in python?

209 Views Asked by At

I have a ABC.dat file which contains many signals along with their corresponding values.

I want to select few signals from this ABC.dat file and would like to export these signals to a new XYZ.dat file.

How can I achieve this using mdfreader library in python?

1

There are 1 best solutions below

1
danielhrisca On
from asammdf import MDF

in_mdf = MDF(original_file)  # r'D:\measurement1.dat
out_mdf = in_mdf.filter(signals) # signals = ['VehicleSpeed', 'Acceleration'] ...

out_mdf.save(reduced_file) # r'D:\speed_and_acceleration.mdf'

in_mdf.close()
out_mdf.close()