Spooled file extract functions

Spooled file extract functions

This section lists and describes the functions available to extract information from the spooled file. Normally you do not need to think much about this as the functions are normally added when you select an area in the input spooled file, so you do not need to remember all the details, but this can be used for reference if you want to verify/understand the elements of an existing template.

 

The spooled file extract functions are:

 

1.ng:spoolMap.

This maps a window of text from the spooled file - either from the current page or from a specific page.

 

2.substring.

This function can e.g. be used for extracting a substring of the current spooled file line - within a repeat of spooled file lines. The line repeat is normally inserted within a page repeat.

In general it extracts a section of the input string. For the substring you will normally see it used as this: substring(.,57,4). The first parameter is a dot, which refers to the current node of the input file. In the example substring(.,57,4) the spooled file data in position 57 to 60 of the current spooled file line is extracted. The linked video below shows how this may be used.

 

3.ng:spoolMapRel (only for version 2 spooled files).

This can only be used within a repeat over spooled file lines. Within that repeat the ng:spoolMapRel refers to relative spooled file lines i.e. relative line 0 is the current line, relative line -1 is the spooled file above the current line and relative line +1 is the line below the current spooled file line. If the ng:spoolMapRel function only refers to the current spooled file line, then it is the same as substring().

These functions does the same: substring(. , 57, 4) and ng:spoolMapRel(. , 57, 4, 0, 1).

 

Here is a video that shows how to use the ng:spoolMapRel function:



4.ng:spoolMapCond (only for version 1 spooled files).

This function extracts a window of text while testing the contents of each spooled file line. For Version 2 spooled files you should instead use a line repeat.


    • Related Articles

    • Built-in functions

      InterFormNG2 comes with multiple built-in XPath functions. The built-in functions can be used XPath expression in both the designer and in the workflow. While editing an XPath expression you can click the icon looking like a magnifying glass: - and ...
    • Introduction to the Spooled file extractor

      IMPORTANT: The spooled file extractor is no longer supported. Any spooled file extractor definitions, that has previously been designed can still be used in the workflow, but they cannot be edited. The better alternative is to use the designer for ...
    • Spooled file into Excel

      This section shows how a spooled file can be converted into Excel. The example relates to a spooled file, that has a format like below: The spooled file is a multi-page spooled file with a header, some details lines (in the middle blue frame), which ...
    • Spooled file split

      You might want to split up spooled files during InterFormNG2 processing. The reason might be, that the input spooled file may contain multiple documents (e.g. invoices), and that you want to create one PDF file (or email) for each invoice. There are ...
    • Enrich spooled file from database

      Enrich spooled file from database It is possible to change the contents of a spooled file (as known on the IBM i platform) and to add data from an external database with the advanced special workflow component: Enrich spooled file from database. You ...