11-05-2009 12:19 AM
11-06-2009 01:03 PM - edited 11-06-2009 01:04 PM
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.
11-09-2009 09:35 AM
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