Need

To combine multiple text files into a single one file, it is recommended to use the “Concat Files” action. 

It allows concatenating multiple files specified by In File Mask parameter into a single one, set by Out File Name.

img4

To see more details, please refer to the documentation.

The common need, and the following example, is to only keep the first Header and the last Footer and delete all the others.


Summarized Solution

Headers and Footers are handled thanks to the following parameters


Name

Mandatory

Default

Description

Keep Header On First

No

True

Keep the header on the first file concatenated.

Keep Footer On Last

No

True

Keep the footer on the last file concatenated.

Header Text

No


Header text to remove in each file.

Header Size

No


Number of header characters to remove in each file.

Footer Text

No


Footer text to remove in each file.

Footer Size

No


Number of footer characters to remove in each file.

Detailed Solution

The first step is to specify the text to be removed. This can be done by using the text size or the text itself.


  1. When using the size

It is necessary to compute the exact size of the text to remove. 

Line breaks are considered as one character each.

For example:

If your files have the following header :


 img1


The header text has 23 characters, and the “\n” line break counts as one character.
In that case, Header Size = 24.


img3


  1. When using the text

It is needed to enter the header text and add one space to represent the line break. 


 img2


Note that if:

  •  "\n" is used, it is considered two characters

  • "\r\n" is used, it is considered four characters (4 spaces)


If the size calculated is not correct, some part of the header will still be left in the output file (for example, a line break) or part of the first line of the source files will be truncated.


Once Header Text/Footer Text is set, make sure the following parameters must have been set as well

  • Keep Header On First = True

  • Keep Footer On Last = True