Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to copy and rename a tdms file?

85 views
Skip to first unread message

daHans

unread,
Apr 23, 2007, 3:40:08 AM4/23/07
to
Hi all,
I need to copy and rename a tdms file in Labview.
 
I've tried the following:
1) Read the whole tdms file as a string (with vi "Read from Text File")
2) Search and replace the "...tdms" names from the source file (with "Search and Replace String")
3) Write the replaced string into the new TDMS file with vi "Write to Text File"
 
But the problem in this procedure is that there are some line breaks in the new tdms file and so the tdms file is incorrect :-(
 
Has anybody an idea how I can copy and rename an tdms file?
 
Best regards
daHans

daHans

unread,
Apr 23, 2007, 10:10:07 AM4/23/07
to
Hi,
I haven't posted an example file because it's a general question "how can tdms files copied and renamed?
But thanks for your answers :-)
daHans

Herbert Engels

unread,
Apr 23, 2007, 10:10:09 AM4/23/07
to
Short answer
You can copy and rename TDMS files using either LabVIEW functions,
Windows Explorer or whatever tool you prefer. You can either copy /
rename the TDMS and the TDMS_INDEX file, or just the TDMS file. If you
have saved any properties / values that you need to adapt to the
new file name, use the TDM Streaming functions do modify them as needed.

Details

TDMS files do not have any "built-in" references to the TDMS_INDEX
file. You can even delete the TDMS_INDEX file and we will regenerate it
the next time you access the file. If you have the NI DataFinder
running, the index file will be "magically" recreated by the DataFinder background
process. The information contained in the TDMS_INDEX file is redundant
to parts of the TDMS file, the index file just speeds up reading quite a bit.

This is a big difference between TDMS and TDM files. If you want to
rename a TDM file, you will have to replace an internal string that
points to the binary part of the TDM file. You might be able to find
the details on that in some other developer zone thread, I answered it
there a couple of weeks ago.

Processing a TDMS file as a string is generally a bad idea because it
is a binary file and string processing will convert it to an
alphanumeric character set and thereby corrupt the file.

Herbert

daHans

unread,
Apr 24, 2007, 2:10:10 AM4/24/07
to
Hi Herbert,
thanks for your great answer!!
:-)
daHans
0 new messages