I am new in the forum, and I have been learning a lot from the answers to the rookie questions. Thank you so much for that!!
I can’t figure out how to replace date vars from a text file with my own variables. I already burned my chances with all kind of approaches from this forum.
I have this text like a .mxl
set timestamp on;
spool sjwur on to 'OTU.err';
login 'user' 'pass' on 'qwerty.oracleoutsourcing.com:3005';
alter database 'OTU'.'OTU' set variable 'Last_Week' '"29-18"';
alter database 'OTU'.'OTU' set variable 'This_Week' '"30-18"';
alter database 'OTU'.'OTU' set variable 'Next_Week' '"31-18"';
alter database 'OTU'.'OTU' set variable 'Forecast_Week' '"37-18"';
logout;
And I have an array of Strings with the new dynamic variables in the same format Week-YY like 32-18.
So you have an array like {“WW-YY”, “WW-YY”, “WW-YY”, “WW-YY”} (different elements) and you want to replace it in the file in the four rows that you have shown.
Create a “templateFile.txt” which looks like this :
set timestamp on;
spool sjwur on to 'OTU.err';
login 'user' 'pass' on 'qwerty.oracleoutsourcing.com:3005';
alter database 'OTU'.'OTU' set variable 'Last_Week' '"{0}"';
alter database 'OTU'.'OTU' set variable 'This_Week' '"{1}"';
alter database 'OTU'.'OTU' set variable 'Next_Week' '"{2}"';
alter database 'OTU'.'OTU' set variable 'Forecast_Week' '"{3}"';
logout;
Read the text file using Read text file activity.
On the txtContent do this :