Flat File Delimiters and Text Qualifiers in Biml
Three Ways to Specify a Delimiter
Delimiters and text qualifiers in Biml flat file definitions accept the same three formats. Pick whichever fits the file at hand.
1. The Named Enum
The named enum is the most readable option. The supported values are:
- CRLF
- CR
- LF
- Semicolon
- Comma
- Tab
- VerticalBar
- UnitSeparator
Use the enum when the delimiter is one of the well known ones. The Biml engine maps each name to the right underlying character at compile time.
2. Hex Codes
Any ASCII character can be expressed by its hex code, written as an underscore followed by x, the four digit hex value, and a closing underscore. A double quote character is U+0022, so it would be written as x0022.
Hex codes are useful when the delimiter is a control character or a non printable byte that does not have a name in the enum. They also serve as an unambiguous fallback when a literal character would be visually confusing.
3. The Literal Character
The literal character also works, but encoding rules apply depending on where the value appears.
When the value is set as a Biml attribute, encode it with standard XML entities. A double quote becomes the entity form:
<FileFormats>
<FlatFileFormat Name="QuotedCsvFormat" TextQualifier=""" />
</FileFormats>
When the value is set inside an SSIS expression, escape it with a backslash instead. The expression engine, not Biml, parses the string at runtime.
<Connections>
<Connection ConnectionName="QuotedCsvConn">
<Expressions>
<Expression ExternalProperty="TextQualifier">"\""</Expression>
</Expressions>
</Connection>
</Connections>
When to Use Each
For everyday delimiters such as comma, tab, or vertical bar, the named enum keeps the Biml readable. For unusual delimiters that are still ASCII, the hex form is unambiguous and copy paste safe. The literal character form is fine for one off cases but requires care to encode or escape correctly depending on the context. Sticking to the enum where possible avoids the question entirely.