LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

combining TDMS files

Hello,

I use LabVIEW 8.5 to collect EEG data that are saved into TDMS files. Sometimes things go wrong, like an electrode falling off the participant, and we need to stop the

recording and then restart it. Now we have two TDMS files, but our analysis code is built to read only one.

 

I know how to load TDMS files and obtain my data. I will need to cut some of the bad data at the end of the first file. I would then like to load the second file, concatenate the two sets of good data, and save the result as a single TDMS file for our regular analysis code.

 

I am not sure how to save the single new TDMS file. Usually I save to TDMS from my acquisition VIs.

 

Could anyone suggest how to do this?

 

Thank you,

Frenk

0 Kudos
Message 1 of 5
(4,005 Views)

All you have to do is a TDMS Read from one file and TDMS Write to the other.  I would read from the "new" file and write to the "old" one.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,988 Views)

Reading the data and writing it back is probably the safest bet, because you can review the data before writing it back.  But TDMS files can be combined just by using a command line binary copy, using the command line call.

 

copy /b File2.tdms + File1.tdms Output.tdms

 

Here are several examples of this.

 

http://forums.ni.com/t5/LabVIEW/Rearrange-TDMS/td-p/2449740

https://decibel.ni.com/content/docs/DOC-22844

 

 TDMS files in this way are more similar to text files, where if you want to add one to another, you can really just paste the contents of one, after the other.

0 Kudos
Message 3 of 5
(3,971 Views)

Thank you to both individuals who responded to my question.

 

I may need to review the data to trim away some bad stuff at the end of the first file, so I will attempt that first.

 

It is nice to know the command line option for simpler data!

 

 

Both your responses are much appreciated,

Frenk

0 Kudos
Message 4 of 5
(3,940 Views)

I haven't used it yet, but in 2015 there is a TDMS delete function.  So if you combine data and later want to remove samples this might be an option too.

Message 5 of 5
(3,899 Views)