Welcome Guest! Log in
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

Remove Header/Footer from files concatenated with Concat Files action

    When you want to combine mutliple text files into a one file, the "Concat Files" action is the one you will want to use.

    It allows you to concatenate multiple files that fit the mask that you put into "In File Mask" option.

    img4

     

    When concatentating your files with this action you might want to keep the header only in the beginning of the output file and the footer at the end.

    To achieve that you will have to use the following options :

    - "Keep Footer on Last" (activated by default)

    - "Keep Header on First" (activated by default)

    - "Header Text" or "Header Size"

    - "Footer Text" or "Footer Size"

     

    To remove the headers/footers from the source files, Stambia uses the length of the header/footer.

    Once the length is known Stambia removes the number of characters corresponding to this value from the begining/end of the file.

    This is activated by options "Header Text" or "Header Size" to remove headers and "Footer Text" or "Footer Size" to remove footers.

    You can either calculate the number of characters to be removed by yourself and then use "Header Size" and "Footer Size" options or let Stambia calculate it by entering "Header Text" and "Footer Text".

    Then if the options "Keep Footer on Last" and "Keep Header on First" are activated the header won't be removed from the first file treated and the footer won't be removed from the last file treated by the action.

     

    It is important to correctly count the charcaters in the line breaks.

    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 the "Header Size" you would have to put 24 characters in this case.

    img3

    If you prefer to use "Header Text" you would have to put the header text and add one space after to represent the line break, note that if you use "\n" it won't be recognized as one character but as two.

     img2

     

    If your files have "\r\n" line breaks you should add 2 additional charcaters (for example two spaces).

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

     

    Deleting a directory with the FileDelete Action

      Here is how to set the properties for deleting the directory "d:/temp/deleteme" and all its content, including subdirectories:

      • DEL_DIR: the parent directory (for example "d:/temp/deleteme")
      • DEL_INCLUDES: a double wildcard "**" which indicates to recursively delete everything inside DEL_DIR
      • DEL_INCLUDES_EMPTY_DIRS: check this box, so that the Runtime deletes the directory once its content is deleted.

      Of course, make sure you set the properties correctly, because the Delete action cannot be undone!

      In order not to delete the "d:/temp/deleteme" once its content is deleted, you can use the following mask "**/*" in DEL_DIR option.

      It allows to delete everything inside the directory (including empty subdirectories) without deleting the main directory.

      Articles

      Suggest a new Article!