DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Script to load multible .tdms and save as .xlsx or .csv or .txt

Hello,

 

i have no experiece with Diadem Script, but i need a script which loads automatically all .tdms files in a folder and saves it as .xlsx or .csv. or .txt.

Thank you very much for any support.

 

best regards,

Udo

0 Kudos
Message 1 of 4
(2,493 Views)

Hi Udo,

 

Sorry, but your request will require additional information.

 

1) TDMS has a nice structure with channel groups and channels, with properties for both channels and channel groups.The file types you are sending the data to, as all very unstructured and would require knowing just what format the output would need to be in.

 

2) So in order to be helpful would require a sample of the input files, as well as what will be reading the files after they are exported to CSV, xlsx or Txt.

 

3) I find the abilities in DIAdem to see the data in VIEW pane, Perform calculation in Analysis tab, and output to PDF in Report to give features that can not do in Excel and are very powerful.

 

Anyway you will need to supply more details that what you have in the initial post.

 

Paul

0 Kudos
Message 2 of 4
(2,445 Views)

Hello Paul,

 

thank you very much for your answer. You are probably right but i know much more about Visual Basic for Applications then i know about Diadem.

I attached an example file.

I was wondering if there is a script which loads all Diadem files from a folder and saves it again as .xlsx (or .txt,..)

Does the example file helps?

Thanks again

 

best regards,

Udo

0 Kudos
Message 3 of 4
(2,442 Views)

Hi Udo,

 

There are 2 main components to your desired script:

 

1) Looping over all the data files in a particular folder

2) Loading all those data files and exporting them to a CSV of XLSX file

 

I'm going to skip over 1) for now and see what you think of this solution for 2).

 

DataFilePath = "D:\NICS\Discussion Forums\Udo_73\example.tdms"
XlsxFilePath = NameSplit(DataFilePath, "P") & NameSplit(DataFilePath, "N") & ".xlsx"
Call Data.Root.Clear
Call DataFileLoad(DataFilePath)
Call DataFileSave(XlsxFilePath, "ExcelTdmExport")

 

Let us know if that export file choice is OK with you,

Brad Turpin

Principal Technical Support Engineer

NI

0 Kudos
Message 4 of 4
(2,317 Views)