b = fileconcat(ʃdictionary_name,ʅ output_file_name, file_name1ʃ, ..., file_nameNʅ);
- Concatenate cases: Reads cases from each input file and writes them to the output file, skipping invalid and duplicate cases. This mode requires a data dictionary that describes the format of the input and output data files so that cases may be validated and duplicates may be identified. Concatenate cases mode may be used with all types of data sources.
- Concatenate file contents: Simply appends one file to the end of another regardless of the file contents. This mode will not work for CSPro data sources that are not text (such as CSPro DB data sources).
To peform a case concatenation, you must specify a dictionary_name that specifies the layout of the data files being concatenated. When the dictionary is specified, the files are combined by reading each case from each of the input files and writing them to the output file. In this mode, invalid cases and duplicate cases are automatically removed from the output file.
To perform content concatenation, do not specify a dictionary. In this case, the input files are appended together without examining their contents. This will be faster but will not eliminate duplicates or invalid cases.
The
output_file_name is a string expression giving the name of the output file that will contain the concatenated data. The arguments
file_name1 to
file_nameN are either string expressions or string
lists that contain the names of specific files or a wildcard specification of a group of files.
The function returns a logical value of 1 (true) if successful and 0 (false) otherwise.
fileconcat(CENSUS_DICT, "14combined.csdb", "../Data/14*.csdb");
If you wish to create an encrypted output file, use a .csdbe extension:
fileconcat(CENSUS_DICT, "output.csdbe", "input.csdb");
In this scenario the user will be prompted to provide a password for the output file. If you prefer to specify the password yourself, include it in the output file specification using a
connection string:
fileconcat(CENSUS_DICT, "output.csdbe|password=1234", "input.csdb");
Likewise if the input file was a .csdbe file, the user will have to provide the password during the run; or, you can include the password as a connection string.
Content concatenation uses the following syntax:
fileconcat("DMV.txt", "District of Columbia.txt", "Maryland.txt", "Virginia.txt");