Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.

Qlik Replicate and File target: How to rename output files LOAD######## to table name format on Windows

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
john_wang
Support
Support

Qlik Replicate and File target: How to rename output files LOAD######## to table name format on Windows

Last Update:

Aug 1, 2023 4:03:49 AM

Updated By:

Sonja_Bauernfeind

Created date:

May 18, 2023 9:10:59 AM

When using a File as a target in a Qlik Replicate task, the Full Load data are written to CSV or JSON files (depending on the endpoint settings). The Full Load Files are named using incremental counters e.g. LOAD00000001.csv, LOAD00000002.csv. This is the default behavior. 

In some scenarios, you may want to use the table name as the file name rather than LOAD########.

This article describes how to rename the output files from LOAD######## to <tableName>######## format while Qlik Replicate running on a Windows platform.

For Qlik Replicate running on a Linux platform, see Qlik Replicate and File target: How to rename output files LOAD######## to table name format on Linu....

Resolution

The detailed steps:

  1. Open and modify repctl.cfg 

    Default file location: C:\Program Files\Attunity\Replicate\bin

    Set enable_execute_user_defined_commands from false to true 

    Example: "enable_execute_user_defined_commands": true,

  2. Restart the Qlik Replicate Server service. 

  3. Create a text/batch file named myrename2.bat and save it in the Qlik Replicate Server folder: C:\Program Files\Attunity\Replicate\bin

    Content of the file:
     off
    for %%a in (%1) do set "fn=%%~na"
    set sn=%fn:~4,8%
    rename %1 %2_%3__%sn%.csv​
  4. Set the File Target endpoint and configure it with the following settings: 

    General
    Target folder:
    C:\temp\FileTarget
    Maximum file size(KB): 10240 (default 1000000)

    General Settings.png

    Advanced
    Post-process files
    Command name: myrename2.bat
    Working directory: leave blank
    Parameters: ${FILENAME} ${TABLE_OWNER} ${TABLE_NAME}

    Advanced Settings.png

  5. Startup or Reload the Full Load ONLY task and verify the file output.

    It will typically look like:

    file output.png

    Where dbo is the source table schema name, KITPK100000 is source table name, 0000000<n> is the unique incremental number.

    You can tailor the
    myrename2.bat file for any particular needs.

 

Environment

Qlik Replicate 
File target

Related Content:

Qlik Replicate and File target: How to rename output files LOAD######## to table name format on Linu...
Qlik Replicate and ADSL target: How to rename output files LOAD######## to table name format (Replic... 

Internal Investigation ID(s):

Support cases #00080300 

 

Labels (1)
Comments
bryce_leinan
Contributor III
Contributor III

@john_wang , thanks for this! I am going to give it a shot today. 

Version history
Last update:
‎2023-08-01 04:03 AM
Updated by: