Applies to:
Denodo 8.0
,
Denodo 7.0
,
Denodo 6.0
Last modified on: 04 Jun 2020
Tags:
DF data sources
Goal
This document describes how to access fixed width files.
Content
To access fixed-width files with information in a single row, a Delimited File data source can be used. In the data source creation screen click on “Use tuple pattern” and define a regular expression in the “Tuple Pattern” field. Note that regular expressions in Denodo use a Java Pattern. When creating the regular expression, external tools like the regular expression tester for Java can be useful.
Example:
A fixed-width file with information in a single row:
President Year first inauguraPolitical Party
George Washington 1789None
John Adams 1797Federalist
Thomas Jefferson 1801Democratic-Republican
James Madison 1809Democratic-Republican
James Monroe 1817Democratic-Republican
John Quincy Adams 1825Democratic-Republican
This file has three columns. The widths of the first two columns (from left to right) are fixed at 21 char and 19 char. The width of the third column ranges from 1 char to 21 char. So this tuple pattern is used: (.{21})(.{19})(.{1,21})
References