CSV data adapter configuration details
The structure of CSV data adapter configuration is defined below.
<dataAdapter assembly="AtHoc.DataIntegration.dll" class="AtHoc.DataIntegration.Adapter.CSV.CsvDataAdapter" enable="true"> <!-- CSV configuration goes here --> <skipFirstLines>1</skipFirstLines> <delimiter>,</delimiter> <!-- Supported .csv file encoding formats are: UTF8, UTF8-BOM, or WIN1252. The default is WIN1252. Optional--> <encoding>WIN1252</encoding> <readFolder>C:/tmp/</readFolder> <!-- Enable below line and specify path if processed files need to be moved to a different location: Optional --> <!--<processedFolder>C:/tmp/processedFolder/</processedFolder>--> <!-- Column names in the order they are presented in the CSV --> <csvColumns> <csvColumn>Username</csvColumn> <csvColumn>Firstname</csvColumn> <csvColumn>Lastname</csvColumn> <csvColumn>OrgH</csvColumn> <csvColumn>Date</csvColumn> <csvColumn>DateTime</csvColumn> <csvColumn>AllUsers</csvColumn> </csvColumns> </dataAdapter>
- <skipFirstLines>: This node specifies the number of lines to exclude from the .csv file while processing data. Set this value to 1 if the input .csv file contains headers. If the headers are spread over multiple lines, set this value to the number of lines that are used for headers.
- <delimiter>: This node specifies the delimiter used in the .csv file. The default value is comma (,). However, files with other delimiters are also supported. For example, the pipe (|) symbol.
- <encoding>: (Optional) This node specifies the encoding format of the .csv file. If not specified, the client assumes that the encoding of the .csv files is Windows1252. The other supported formats are UTF8 and UTF8-BOM. Only one encoding format can be specified.
- <readFolder>: Absolute path of the folder where the .csv files are located. The .csv data adapter can process all files present in a folder. You should keep only .csv files in this folder.
- <processedFolder>: (Optional) If specified, once the files are processed by the data adapter, they are moved to this location. The value must be an absolute path.
- <csvColumns>: The ordered list of user-defined names for columns to use as node names in the resulting XML file. This node has the following sub node:
- <csvColumn>: The node name in the resulting XML file. You should keep this name simple and without spaces or special characters. Consider using a name that is a valid name for XML nodes. You will need this node name when writing the XSL for the data processor.