Is there a way to remove one channel group from a tdms file and write a new tdms file?

3 views (last 30 days)
Using the new tdms functions brought in with 2022b (tdmsread, tdmswrite, tdmsinfo, tdmswriteprop, etc) what is the best way to take an existing tdms file and remove one channelgroup from it and write a new tdms file with the new table? Is there an efficent way of maintaining the existing tdms props and writeing that to the new tdms file as well? TDMS files would have 3 or more channel groups with a minimum of 5 channels in each group that would need to be transfered to the new tdms file. Thanks for the help

Answers (1)

Swaraj
Swaraj on 10 Mar 2023
You can execute the following steps to remove a channel group from an existing TDMS file and create a new TDMS file with the updated data.
  1. To read a TDMS file and obtain its information, such as the names and properties of the channel groups, use the “tdmsinfo” function.
  2. Use “tdmsread” function to read the TDMS data into MATLAB.
  3. Remove the channel group that you want to exclude from the TDMS data structure.
  4. tdmsData.(channelGroupToRemove) = [];
  5. Also remove it from the “ChannelList” table in the “tdmsInfo” object.
  6. Use “tdmswrite” function to write the updated TDMS data and metadata to a new file.
Please go through the following Documentations for more details.
For “tdmsinfo” function:
For “tdmsread” function:
For “tdmswrite” function:

Tags

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!