# 2.7.13 files2dc

## Contents

Data: Connect Multiple Files

## Brief Information

Create data connection to multiple files

Minimum Origin Version Required: 2020b

 1. string fname$="C:\examples\Gasoline 1.mat%(CRLF)C:\examples\Gasoline 2.mat%(CRLF)C:\examples\Gasoline 3.mat"; files2dc dc:=MATLAB;  2. files2dc dc:=CSV fname:="%Ytest2.csv%(CRLF)%Ytest1.csv" samebk:=1 dlg:=1;  3. files2dc dc:=CSV src:=1 path:=%YData samebk:=1;  4. files2dc dc:="Import Filter" fname:="%YS32-014-04.dat%(CRLF)%YS21-235-07.dat%(CRLF)%YS15-125-03.dat" samebk:=1;  ## Variables Display Name Variable Name I/O and Type Default Value Description Data Connector dc Input string Specify the file type of Data Connector. Source src Input int 0 Specify the source of files to be imported. Two options are available: • 0:Specified Files • 1:Files in Specified Folder File Names fname Input string fname$
Specify the files to be imported. Full path should be included.
Folder path

Input

string

Availabel when Source is set to Files in Specified Folder. Specify the folder path.
Same Book samebk

Input

int

0
This checkbox is available if the selected Connector type supports importing multiple files in the same workbook, CSV Connector for example.
Open Dialog for First File dlg

Input

int

0
Whether to open the Selection dialog for the first file.

## Description

This X-Function is used to connect to multiple files at a time. Currently limited connector types are supported: CSV, Excel, MATLAB, HDF, NetCDF Connectors + Import Filter for workbook; Matlab, HDF, and NetCDF Connectors for matrix. The dialog supports choosing specified files or all files in a specified folder. For some types like the CSV Connector, you can specify the import of multiple files into the same workbook. You do this by selecting Open Dialog for First File which opens the Connector dialog allowing you to specify the import settings. All remaining files will follow these settings.