-2

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?

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92

1 Answers1

0
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()
danielhrisca
  • 665
  • 1
  • 5
  • 11
  • Remember that Stack Overflow isn't just intended to solve the immediate problem, but also to help future readers find solutions to similar problems, which requires understanding the underlying code. This is especially important for members of our community who are beginners, and not familiar with the syntax. Given that, **can you [edit] your answer to include an explanation of what you're doing** and why you believe it is the best approach? – Jeremy Caney Apr 06 '23 at 18:54