Home Flat Files rules Fixed-length file and end of line characters

Fixed-length file and end of line characters

Written by 
Rate this item
(1 Vote)

In the article is mentioned issue of end of line character in source fixed length files. 

Every row in a fixed-length file must have the same length. At the and of row can be:

  1. no end of line characters;
  2. lf - line feed character;
  3. cr + lf - carriage return and line feed characters;

If you use any text editor to create the file, it is going to add end of line characters.

On Unix it is lf character and o windows cr + lf characters. This means that on Unix it is one byte while on Windows, 2 bytes. So, the row length is different for Unix and Windows. If a file is edited on Windows and on Unix randomly, or if the method of loading files from Windows to Unix is unknown (binary, character), it is possible to incorrectly define the length of rows, which will result in errors in loading the flat file.

Defining fixed length flat files must be properly set in the options:

  1. Line sequential
  2. Number of bytes to skip between records

The settings must remain in accordance with end of line characters.



Read 8017 times