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…

Writing at the top of a file

    Stambia provides an option on the Write File Process Action that allows to prepend text at the beginning of a file.

    In this article, we are going to see several examples and use cases of this functionality


    Common usage

    To write a line of text at the beginning of a file:

    1. Add a Write File Action in a Process
    2. Set the file's path
    3. Set the Txt Write Append parameter to 'before'
    4. Write your text in the body of the action






    SQL File Export statistics and information in the exported file

    The idea is to export data of a rdbms table to a file with SQL File Export, and then add at the beginning of the file:

    • File's name
    • Number of rows exported

    Process Overview


    As you can see, we first export the table and then write a header line containing the information retrieved with the help of Process variables.

    Example of result:



    Writing the result of a SQL Select

    We have here the same goal as the previous example, but we want to add some more information about the execution.

    More precisely, we want to add the result of a query.

    Process Overview


    We simply added a SQL Operation which executes a select statement, and we binded it to the write file.

    Then, we are using the result with :{columnName}: syntax.


    For more information on SQL Operations and binds, please refer to this this article.



    Suggest a new Article!