I have a text file which is divided into a parts called "case".
Each case contain fields beginning with sign $ and @.
Here is asample:
Code:
case "6": ### - rcmProcStaCP2DownEvent
$bs2sisTrapSender = $1
$bs2sisTrapTime = $2
@Summary = "description_1"
@Severity = 5
@Type = 1
@ExpireTime = 3600*12
case "7": ### - rcmIncompatibilityAlarm
$bs2sisTrapSender = $1
$bs2sisTrapTime = $2
$bs2sisTrapAlarmFaultId = $3
$bs2sisTrapCause = $4
$bs2sisTrapAlarmX733Cause = $5
$bs2sisTrapInformation = $6
@Summary = "Description_2"
@Severity = 5
@Type = 1
@ExpireTime = 3600*12
I'd like to add at the end of each case new field @Identifier.
@Identifier should contain 4 repeatable fields + all fields beginning with $ in each case.
Here is an example:
Code:
case "6": ### - rcmProcStaCP2DownEvent
$bs2sisTrapSender = $1
$bs2sisTrapTime = $2
@Summary = "description_1"
@Severity = 5
@Type = 1
@ExpireTime = 3600*12
@Identifier = @Node + " " + @AlertGroup + " " + @AlertKey + " " + @Type + " " +$bs2sisTrapSender+ " " +$bs2sisTrapTim
case "7": ### - rcmIncompatibilityAlarm
$bs2sisTrapSender = $1
$bs2sisTrapTime = $2
$bs2sisTrapAlarmFaultId = $3
$bs2sisTrapCause = $4
$bs2sisTrapAlarmX733Cause = $5
$bs2sisTrapInformation = $6
@Summary = "Description_2"
@Severity = 5
@Type = 1
@ExpireTime = 3600*12
@Identifier = @Node + " " + @AlertGroup + " " + @AlertKey + " " + @Type + " " +$bs2sisTrapSender+ " " +$bs2sisTrapTim+ " " +$bs2sisTrapAlarmFaultId+ " " +$bs2sisTrapCause+ " " +$bs2sisTrapAlarmX733Cause+ " " +$bs2sisTrapInformation
Can you guys help me out how to do that ?