How To: Use RenameExpression parameter to name new files
Scenario:
Imagine you want to place your new replicated files depending on the timestamp when it was replicated or from which channel or from which capture location (database location). Below we will see how these expressions can be used and their variations.
By default If /RenameExpression parameter is not set Local Data Processing creates a csv file with current timestamp-<TableName>. In our case a file called 20180613013511263-table1.csv is created where 20180613013511263 is a timestamp and 'table1' is the table name.
Pre-requisites:
1. A channel is already created with an oracle source and file Target
2. Table 'table1' is already added to list of Tables
3. An action Fileformat /Csv is added to Target to get file in csv format
4. All the RenameExpression actions are on Target group
Steps:
Step 1) Add below action to get the integrate timestamp for the file.
chn1 TGT * * Integrate /RenameExpression={hvr_integ_tstamp}.csv
Step 2) Add below action to get the specifics of integrate timestamp. For example, you want to create directories for year, month and day
chn1 TGT * * Integrate /RenameExpression="{hvr_integ_tstamp %Y}/{hvr_integ_tstamp %m}/{hvr_integ_tstamp %d}/{hvr_integ_tstamp %H}/{hvr_tbl_name}.csv"
Above are the few samples which are commonly used but there are more expressions which can be used for a similar purpose and are listed in our manual. Please refer link https://www.hvr-software.com/docs/actions/integrate#Integrate-Parameters for the same.