pls help me with the simple logic not able to hit at this moment.
If both DEPARTMENT & BU are present in file print/take only DEPARTRMENT value or else print/take BU value
input file 1:
DEPARTMENT: A
BU: XYZ
output
A
Input file 2
BU: 123
Output
123
I tried something like below it is printing both, please suggest. In jinja we use default keyword for this.
Storing "delayed" values and/or statuses in variables is the right idea.
Your implementation requires that a BU, if present, must occur after a DEPARTMENT.
Otherwise you would need to further delay the conditional printing, perhaps up to an END section if DEPARTMENT can occur on the very last line.
Thank you MADEINGERMANY for the right direction.. I will proceed with this logic..
Yes the sequence is DEPARTMENT comes first. DEPARTMENT and then BU.
But using END is more secure as suggested I guess..