MergeFiles
Opens and merges the specified files, returns the reference to the merged file.
Syntax
MergeFiles(filename_list, gap)
Parameters
Parameter |
Type |
Description |
---|---|---|
filename_list |
string |
The list of files to be merged. File names should be separated by commas |
gap |
number |
Gap between the files (in seconds). See Note below. |
Return
Returns the reference to the merged file.
Note
In the merge process, the data (for the same variable) from the second file is appended to the data from the first file. Before appending, the timestamps of the variables in the second file are shifted by the value equal to duration_of_the_first_file + gap.
Since the function uses commas as separators between file names, it is assumed that each file name does not contain commas.
Examples
Python
import nex
import json
dataDir = "C:\\Data\\"
files = []
files.append(dataDir + "file1.nex5")
files.append(dataDir + "file2.nex5")
doc = nex.MergeFiles(json.dumps(files), 1.)
NexScript
dataDir = "C:\Data\"
file1 = dataDir + "file1.nex5"
file2 = dataDir + "file2.nex5"
mergeList = file1 + "," + file2
doc = MergeFiles(mergeList, 1.)