File Connector Guide

File Connector Guide

File Parsing and Content Type Properties

File Parsing and Content Type Properties

You can configure an event source based on the specific event source types available for your connection type.
In the Event Source properties, you determine how the content is handled as it is parsed. After the event source is published, the connection waits for a new file, parses the contents on arrival, and represents the contents according to the properties for:
  • File Parsing
  • Content Type
The following table describes the file parsing properties:
Property
Applies To
Description
Character Set
All Event Source Types
Required. Determines the encoding of the file. If none specified, the connector uses UTF-8.
Delimiter
Delimited Content Parser
Required. The delimiter character for delimited files.
To specify a space or a tab character as a delimiter, use the escaped character, "\s" or "\t".
Text Qualifier
Delimited Content Parser
Required. The text qualifier for delimited files.
To specify a space or a tab character as a qualifier, use the escaped character, "\s" or "\t".
Ignore First Record
Delimited Content Parser
Determines whether the connector processes the first row of a delimited file as a data row. You can select from the following options:
  • Yes
    : The connector does not process the first row of a delimited file as a data row.
  • No
    : The connector processes the first row of a delimited file as a data row. If you select
    No
    , you must provide custom headers by using the Columns Descriptor attribute.
The default value is
Yes
.
Split Rows
Delimited Content Parser
Fixed Width Content Parser
Determines whether to process each row separately, convert each row to a process object, and generate a separate event for each of them.
Columns Descriptor
Delimited Content Parser
Fixed Width Content Parser
Defines the fixed width column headers to be processed. Specify the values in a comma-separated list of names and sizes (in parentheses).
Delimited Content Parser example:
User Name, Password, Email
Fixed Width Content Parser example:
User Name(40), Password(8), Email(14)
These column headers also determine the process object header names when you use Custom Objects, unless you specify a different set of headers (see below).
Ignore Column Inconsistencies
Delimited Content Parser
Fixed Width Content Parser
For Delimited Content Parser, determines:
  • Whether to ignore extra columns in data rows.
  • Whether to add columns with empty string values if columns are missing.
If not enabled, the event source throws an exception when it encounters extra or missing columns.
For Fixed Width Content Parser, determines:
  • Whether to ignore extra characters in rows.
  • Whether to add characters with empty spaces if defined columns have missing values.
Default: No.
The following tables describe all the content type properties:
Property
Applies To
Description
Content Format
File Parser
File Monitor
FTP Monitor
Required. Format of the content to be processed:
  • Ignore
    . Do not process the content.
  • Plain Text
    . Content is a string.
  • Binary
    . Content should be converted to a Base64-encoded string.
  • XML and JSON
    . Content should be parsed and converted to an object or a list of process objects.
  • Attachment
    . Content is an attachment.
Simplify Content
File Parser
File Monitor
FTP Monitor
If enabled, the event source parses XML/JSON content that does not match a valid process object structure and attempts to modify the content structure to match the format of the process objects.
Default: No
Single Object Mode
File Parser
File Monitor
FTP Monitor
If enabled, XML content is converted to a single object.
Default: No
Use Built-in Process Objects
Delimited Content Parser
Fixed Width Content Parser
Select
Yes
, for example, if you work with files that use a different set of fields or you do not know the file headers in advance. The File Connector represents the records as a set of process objects based on the file contents.
Select
No
if you provide a list of field names in Custom Object. This is suitable if you work with similar files and you can reliably anticipate a set of fields (headers) in each one. The event source generates a simple process object for each record of the delimited content file. Default is No.
For details about working with process objects, see Event Process Objects Overview
Custom Object
Delimited Content Parser
Fixed Width Content Parser
If you do not select Use Built-in Process Objects, enter a comma-delimited list of process object header names that represent the file contents. This method enables you to extract only the required data. Generated objects are simpler to work with and require less code to handle in a process.
The names must be an exact match with the header names in the file or the headers defined with the Columns Descriptor. For example:
Name,Street,City,State,Postal Code,Country,Phone
You cannot use "index" as a field name. It is reserved for row index information.
When the file is parsed, if a header you enter here does not exist, the related field is empty in the generated objects.
The custom objects are represented in
NCName
format, to remove any prohibited characters from the header names and ensure they are valid process object field names.

Escape Characters in Custom Objects

If you need to specify a comma character in a column header, add a backslash (\) as an escape character so the file is parsed correctly. For example, if the file contains:
First, Name, Last Name, Address, local, Phone
In this case, the backslash ensures that the comma is not used as a delimiter character when the content is parsed:
First\, Name, Last Name, Address\, local, Phone

0 COMMENTS

We’d like to hear from you!