quired output in form of
hi frnds,
i have a file:
where 1st field is:
eventType,eventTime,loggingTime, probableCause,lsname,slCode
and is 2nd field hav its values and everytime its starting with communicationsAlarm
on the behalf of communicationsAlarm
eventType communicationsAlarm,
eventTime "20111103164448",
loggingTime "20111103164549",
probableCause slFailure,
lsname "VP2HPSGM01L3"
slCode = 5
eventType communicationsAlarm,
eventTime "20111103164448",
loggingTime "20111103164549",
probableCause slFailure,
lsname "VP2HPSHL01L3"
slCode = 6
eventType communicationsAlarm,
eventTime "20111103141027",
loggingTime "20111103141128",
probableCause slFailure,
lsname "VP2HPSGM01L3"
slCode = 6
eventType communicationsAlarm,
eventTime "20111103141027",
loggingTime "20111103141128",
probableCause slFailure,
lsname "VP2HPSHL01L3"
slCode = 5
eventType communicationsAlarm,
eventTime "20111103141027",
loggingTime "20111103141128",
probableCause slFailure,
lsname "VP2HPSHL01L3"
slCode = 14
a
on the behalf of communicationsAlarm i want output as :
if any filed does not hav any value i want print null
eventType,eventTime,loggingTime, probableCause,lsname,slCode
communicationsAlarm,20111103164448,20111103164549,slFailure,VP2HPSGM01L3,5 communicationsAlarm,20111103164448,20111103164549,NULL,VP2HPSGM01L3,5
communicationsAlarm,20111103131313,20111103164549,slFailure,VP2HPSGM01L3,5