Fixed Width File

  • headerRowsToIgnore: the number of records from the top of the file to ignore before the data starts (includes column header)

  • path: the path to the source file to load, this can reference an execution parameter (e.g. @file_path)

  • encoding: the encoding of the file, defaults to UTF8 if not specified, but also supports UTF8_BOM, ASCII, and UTF16

In the column definitions, add the length="number" attribute to denote the width of the column.

<FixedWidthDataSource
headerRowsToIgnore="1"
footerRowsToIgnore="0"
path="C:\Users\Cinchy\Sample.csv" encoding="UTF8">
<Schema>
<Column name="Name" dataType="Text" maxLength="10" length="10" trimWhitespace="true" />
<Column name="Description" dataType="Text" maxLength="50" length="50" trimWhitespace="true" />
</Schema>
<Filter/>
</FixedWidthDataSource>

You can use trimwhitespace to clean up a fixed width file, the trimming will occur after parsing the columns.