Welcome Guest! Log in
Due to some maintenance operations, stambia.org will be switched to read-only mode during the 13th November. It will be possible to read and download, but impossible to post on the forums or create new accounts. For any question please contact the support team.

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

     

    Example:

    CommonUsage

     

     

    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

    processOverview

    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:

    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

    processWithSelectBind

    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.

    Tip:

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

     

    Articles

    Suggest a new Article!