Connecting to a Fixed Width Flat File

You can use this connection:
  • In Enterprise Designer for reading and writing data
  • In Metadata Insights to create physical models
  1. Go to Connections > Flat File.
  2. By default, the screen opens in the create mode. Otherwise, click to add a new Flat File connection.
  3. Enter a Connection Name for the Flat File data connection.
  4. Enter the File Path by clicking Browse and selecting the directory of the file.
  5. Select the Character Encoding of the flat file from the drop-down.
  6. Select the Record Type as Fixed Width.
  7. In the Record Length field, enter the total number of characters in a file record.

Repeat Step 8 to Step 13 to enter details of all fields expected in a file record.

  1. Click Add Field to add a row for a field in a file record.
  2. In the Name column, enter the name for the field value.
  3. In the Type column, select the data type of the field value.
  4. In the Start Position column, enter the position in the file record at which of the field value begins.
    For the first field in a file record, the Start Position counting begins from 1.
  5. In the Length field, enter the total number of characters the field covers, including the character at the Start Position.
    The sum of the Start Position and Length values for any field should be less than or equal to the Record Length
    If the File Record is:
    01234Rob Smith29PitneyBowes 

    Record Length = 27

    For the field 'Name':

    Start Position = 6

    Length = 9

    Name = Rob Smith
  6. Check the Trim checkbox if you wish to trim any white spaces at the beginning and/or end of a field value.
  7. Click Test.
    A message confirms the successful test of the connection.
  8. Click Save.
    A message confirms the successful creation of the connection.
In order to view a sample record fetched using the created Fixed Width Flat File connection, click Preview in the header bar. File records will be fetched and the Fields sorted according to the details provided by you.