DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Merge multiple *.cvs files to a *.dat or *.tdm

Hello,
 
my dyno gives me the values as a lot of cvs-files. In DIAdem 11.1 i can import one file with DataFileImport. How it is possible with a script to merge some cvs-files to ONE *.tdm or *.dat?
Thanks!
0 Kudos
Message 1 of 3
(5,126 Views)

Hello,

You could merge the files by loading them all into the Data Portal and then simply saving the Data Portal to a new file.  The script would look something like this:

'Load the files 1 thorough X
Call DataFileLoad("C:\myfile1.cvs")
Call DataFileLoad("C:\myfile2.cvs")
'...
Call DataFileLoad("C:\myfileX.cvs")

'Save the data
Call DataFileSave("C:\saveddata.tdm", "TDM")

Note that if you want to specify a data plugin (its not automatically associated with the .cvs extension) you could call Call DataFileLoad("C:\myfile1.cvs","CVS","Load") instead, where "CVS" is the name of your DataPlugin.

This method will do a simple open, merge and save.  It opens all the data into DIAdem and exports it under one file.  You may lose some file properties from those files you open after the first one since there can only be one Root in the Data Portal.  If that's not a problem then this should be the simplest solution.

Message Edited by herosphro on 11-06-2009 01:04 PM
John B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(5,099 Views)

Hi Traderhans,

 

This is a common request, so there is already an extensive application that you can quickly adapt to your data files to do this for you.  The application assumes that you already have a DataPlugin that reads these files, and it sounds like you do.  If you wrote your own DataPlugin, you'll need to use that DataPlugin name in line 18 of the "Importing Data From Multiple DataPlugin Files.VBS" file instead of what is in there now.  If you're using the CSV DataPlugin that installs with DIAdem, then you can just leave the "CSV" DataPlugin name in that line.  If you're using the ASCII Import Wizard to load your CSV files, then you can use the STP file you created in that import instead of a DataPlugin.  You can get to this application from DIAdem by selecting the menu "Help >> ni.com/download" then choosing the last of the 6 links at the top of that web page, or you can just go to this URL:

 

http://sine.ni.com/devzone/cda/epd/p/id/3870

 

The application names are messed up at this link, but the applications are fine.  There are 3 of them for DIAdem 8.1 and 9.0 and 3 more for DIAdem 9.1 and later.  In each case there is an application for loading Excel files with an STP file and an application for loading ASCII files with an STP file.  The 3rd application for DIAdem 9.1 and later is for loading ASCII files with a DataPlugin (the preferred approach).

 

Ask if you have further questions,

Brad Turpin

DIAdem Product Support Engineer
National Instruments

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