Hi all,
Saying we have two files:
-
A "Reference File" whose content is "Variable Name": "Variable Value"
-
A "Model File" whose content is a model program in which I want to substitute "VariableName" with their respective value to produce a third file "Program File" which would be a program tailored for my need !
[x004191a@xsnl11p317a TEST_DAE]$ cat Reference
@TargetTable:TT
@CurrentDate:2016-08-02
@TargetDb:CDH_DEV
[x004191a@xsnl11p317a TEST_DAE]$ cat Model_File
/*
===============================================
NOM Script : @TargetTable.tpt
TYPE : Script TPT
DESCRIPTION : DOMAINE METADATA - CHARGEMENT -
AUTEUR : DAE
DATE : @CurrentDate
=============================================== HISTORIQUE
DATE AUTEUR CREATION/MODIFICATION
08/01/2016 DAE CREATION
===========================================================================
*/
USING CHARACTER SET UTF-8
DEFINE JOB TPT_@TargetTable
DESCRIPTION 'CHARGEMENT @TargetTable'
The aim is to produce that third file without using multiple sed substitution operations:
[x004191a@xsnl11p317a TEST_DAE]$ cat Program_File
/*
===========================================================================
NOM Script : TT.tpt
TYPE : Script TPT
DESCRIPTION : DOMAINE METADATA - CHARGEMENT -
AUTEUR : DAE
DATE : 2016-08-02
===========================================================================
*/
USING CHARACTER SET UTF-8
DEFINE JOB TPT_TT
DESCRIPTION 'CHARGEMENT TT'
[x004191a@xsnl11p317a TEST_DAE]$
Any kind of help would be greatly appreciated,
Didier.