kchavan has asked for the wisdom of the Perl Monks concerning the following question:
Output data format should be as below:Status_EventId = "" Status_NmosSerial = "" Status_Acknowledged = 0 acknowledgementStatus = "notAck" additionalText = "" specificProblems00 = "" managedobjectInstance00 = "1.3.6.1.4.1.12.2.2.159#1/1.3.6.1.4.1.12.2.2 +.22#1/1.3.6.1.4.1.12.2.2.0#7863" perceivedSeverity = "warning" neLocationName = "" currentAlarmId = "8557984" lastOccurence = "1408338405832" acknowledgementUserName = "" additionalInfo00 = "RMServiceState =inService" additionalInfo01RMObjectType = "path" notificationType = "alarmRaise" remoteHost = "/10.23.13.153:25061" eventType = "communicationsAlarm" eventTime = "20140818050641" ASid = "3" firstOccurence = "1408338405832" probableCause = "Client Failure" reservationStatus = "notReserved" friendlyName = "B_GSM-R_N0a.12_N11BSC2.01" RawCaptureTimeStamp = 1408338405 Status_EventId = "" Status_NmosSerial = "" Status_Acknowledged = 0 currentAlarmId = "8557984" lastOccurence = "1408338448373" notificationType = "alarmClear" remoteHost = "/10.23.13.153:25061" eventTime = "20140818050723" ASid = "3" firstOccurence = "1408338448373" probableCause = "Client Failure" friendlyName = "B_GSM-R_N0a.12_N11BSC2.01" RawCaptureTimeStamp = 1408338448 Status_EventId = "" Status_NmosSerial = "" Status_Acknowledged = 0 acknowledgementStatus = "notAck" additionalText = "" specificProblems00 = "" managedobjectInstance00 = "1.3.6.1.4.1.12.2.2.159#1/1.3.6.1.4.1.12.2.2 +.22#1/1.3.6.1.4.1.12.2.2.69#711/1.3.6.1.4.1.12.2.2.70#13258/1.3.6.1.4 +.1.12.2.2.106#1057529" perceivedSeverity = "major" neLocationName = "" currentAlarmId = "8557985" lastOccurence = "1408338596741" acknowledgementUserName = "" additionalInfo00 = "RMServiceState =notInService" additionalInfo01RMObjectType = "lo-hotrail" notificationType = "alarmRaise" remoteHost = "/10.23.13.153:25061" eventType = "communicationsAlarm" eventTime = "20140818050646" ASid = "3" firstOccurence = "1408338596741" probableCause = "Transport Failure" reservationStatus = "notReserved" friendlyName = "Trail_S42.3_S42.6_01" RawCaptureTimeStamp = 1408338596
The output file should has header and then data from the input file. I am not able to split file into array and assign vlaues to the keys in desired format. Kindly help meadditionalInfo00,notificationType,eventType,friendlyName "RMServiceState =notInService","alarmRaise","communicationsAlarm","Tra +il_S42.3_S42.6_01"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to split file by two new lines (\n\n) and convert it into array
by NetWallah (Canon) on Aug 20, 2014 at 19:38 UTC | |
|
Re: how to split file by two new lines (\n\n) and convert it into array
by Cristoforo (Curate) on Aug 20, 2014 at 19:19 UTC |