.. highlightlang:: us .. index:: NC_MergeFiles .. _nc_mergefiles: NC_MergeFiles ============= .. us.tag NC_MergeFiles ENGLISH nc.tools New5708 :ref:`NC_MergeFiles` merges NC files into a new NC file by adding the channels to the destination file. .. function:: oError = NC_MergeFiles(svNCAdd, ssNCDest) .. us.return **Return Value** Is 0, if no error occurred or an error object, see :ref:`error_create`. .. us.params **Parameters** .. uparam:: svNCAdd *svNCAdd* is a vector with NC file names. All channels from all files will be added to the file *ssNCDest*. The global attributes will only be added to the destination file from the first file. .. uparam:: ssNCDest *ssNCDest* is the new NC file name. .. us.comment **Comment** If a channel name occurs multiple times in different files, the first channel name will be added without modifing the name. If found again the number 0, 1, 2, etc. will be added. The global attributes will be copied from the first file to the destination file. If the file contains multiple matrices, for example an MDF file, the channels will be added to a matrix with the identical number of records. .. us.example **Example** :: svNCAdd = "C:\\nc-daten\\" + ... ["Test1.xls.nc2", "Test2.xls.nc2", "Test3.xls.nc2", "Test4.xls.nc2"]; ssNewName = "d:/a.nc"; oError = NC_MergeFiles(svNCAdd, ssNewName); if (type(oError) == "error") { MessageBoxError(oError.message); } else { NC_Edit(ssNewName); } .. us.history **History** .. list-table:: :header-rows: 1 * - Version - Description * - R2015.8 - New. .. seealso:: :ref:`overview-netcdf-files`, :ref:`nc_create`, :ref:`NC_AddFiles` :sub:`id-1712210`