Data Model > Available DSCs > Delimited Text DSC
 
Delimited Text DSC
The Delimited Text data source component (DSC) reads and writes case data in a text file that contains delimited, variable length records. The text file normally has a .csv extension.
The internal name of this DSC is mrCsvDsc.
.csv file creation
If the .csv file specified in the connection string does not exist, the Delimited Text DSC will create a new file. The Delimited Text DSC will append data to an existing file that has the same name as the .csv file to be written, but does not attempt to check whether the structure of the existing data and the new data are the same.
By default, the Delimited Text DSC uses the tab character as the delimiter character when writing to a .csv file. To write a different character (such as a comma), use the CsvFieldDelimiter custom connection property.
The Delimited Text DSC terminates each record in the .csv file with a carriage return, line feed (CRLF) character sequence.
Reading from a .csv file
To read a .csv file, the connection to the Delimited Text DSC must include a Metadata Model (MDM) document that describes the data to be read. Typically, the MDM document will be that in an existing .mdd file. The order and type of the variableinstance objects in the MDM document must match the order and type of the delimited values in the .csv file.
If your .csv file contains categorical data, the Delimited Text DSC expects that the categorical values in the file refer to the index value of the category in the corresponding MDM variable. That is, if the delimited value is 3, the Delimited Text DSC matches this to the third category (if defined) in the corresponding MDM variable. The Delimited Text DSC silently ignores any categorical values that do not have a corresponding MDM category.
When working with large datasets, you will want to set the property MR Init Category Names=1 or specify MR Init Custom='UseMetaDataValues=1' in the connection string. This will use the category name or category mapped value for category question(s) during data transformation, which significantly increases performance when exporting data. For more information, see Connection properties or Custom connection properties used by the Delimited Text DSC.
By default, the Delimited Text DSC expects that the delimiter character used in the .csv file is the tab character. To specify a different character (such as a comma), use the CsvFieldDelimiter custom connection property.
See also
Variable definitions when writing to a .csv file
Custom connection properties used by the Delimited Text DSC
Delimited Text DSC: Supported CDSC features
Available DSCs