Line Padding

The Line Padding transformation will pad input text file lines to a configured length “X” with a configured character “C”. If a file line length is longer than or equal to “X” number of characters then the line will be outputted to the result file without change. If a line length is shorter than “X” number of characters, then it will be padded out with character “C” to the length “X”.

To add a Line Padding transformation step to a Route Package Template take the following steps:

  1. Designate file filtering.
  2. Determine whether or not to proceed with route execution on step failure.
  3. Determine line padding length.
  4. Determine line padding character.
  5. Select source file encoding.
  6. Select output file encoding.
  7. Determine post transformation actions.
Note Steps 1, 3, 4, and 5 are mandatory. All other steps are optional.

The following topics provide detailed Line Padding transformation configuration information:

Related topics:

Input Files

The Input Files settings consist of the selection Process only result from preceding step and determining the Name Filter.

Process only result from preceding step

When Process only result from preceding step is enabled only files produced by the preceding step will be used as input for this step.

When Process only result from preceding step is disabled or this is the first step all current working files will be used as input for this step.

Note The Name Filter settings will also be applied on a given set of input files.

Name Filter

Name filtering can either be set to process all files, process all text files, or process files based on a designated filename pattern forwarded by the selection of Process only result from preceding step.

If Process all files is selected, all files forwarded by the selection of Process only result from preceding step are processed.

If Process all text files is selected, all text files forwarded by the selection of Process only result from preceding step are processed.

Text file selection is determined based on the file extension and the MIME type that corresponds to that extension. MIME types are defined in the mime.types configuration file located in:

Administrator's Tool > Server Configuration > Configuration Files

Furthermore, some MIME types can be defined as text by configuring the AdvancedRouting.TextMimeSubtypes server configuration option. For example, to configure the application/xml MIME type to be treated as text, add xml to the server configuration option.

If Process files based on a filename pattern is selected, only the files that match the file globbing or regular expression all files forwarded by the selection of Process only result from preceding step are processed.

Filename patterns

Filename pattern matching supports glob and regexp syntax expressions.

When the designated pattern type is File Globbing then the String representation of the filename is matched using a limited pattern language that resembles regular expressions but with a simpler syntax. For example:

  • Matches files ending in .xml.

    *.xml

  • Matches file names starting with foo. that have a double character extension.

    foo.??

  • Matches file names ending in .1, .2, .3, .4, .5, .6, .7, .8, .9, .0.

    *.[0-9]

  • Matches file names having a single character extension different from 1, 2, 3, 4, 5, 6, 7, 8, 9, 0.

    *.[!0-9]

When the designated syntax is Regular Expression then the String representation of the filename is matched against a Perl5.003 regular expressions. Perl5 extended regular expressions are also supported. For example:

  • Matches files ending in .xml or .txt.

    .*\.(xml|txt)

  • Case insensitive match of data.xml file.

    (?i)data\.xml

Proceed with route execution on step failure

If Proceed with route execution on step failure is checked, the route execution continues even if the step execution fails.

Line Padding

Both the line padding length and line padding character must be configured.

Line padding length

The line padding length must be specified in number of characters. The maximum line padding length is 1024 characters.

Line padding character

The line padding character is specified in Unicode format with \uXXXX where XXXX is the hexadecimal representation of the characters. Only one character is accepted.

File encoding

The source file encoding must be configured. Configuring the output file encoding is not mandatory. If it is not set, the output file encoding will be the same as the source file encoding.

Source file encoding

Encoding of the file that will be transformed specified by the name of a SecureTransport supported character set. The Source file encoding: field has an auto-complete function that lists matching SecureTransport supported character sets.

Output file encoding

Encoding of the file that will be produced specified by the name of a SecureTransport supported character set. The Output file encoding: field has an auto-complete function that lists matching SecureTransport supported character sets.

Post transformation action

The output file names will be the same as the input file names. To change the file names use a Rename transformation step. To configure a Rename transformation step, refer to Rename.

Related Links