I am to delete all stings from starting of file to a certain point using anything, sed, Grep, awk in shell
INPUT
sCSISmart20 TRAP-TYPE ENTERPRISE cyclone DESCRIPTION "Aspi: unable to read the file server hard disk might have problems" --#TYPE "Aspi: unable to read the database file" --#SUMMARY "ASPI: unable to read the file, server hard disk may have problems" --#ARGUMENTS {} --#SEVERITY WARNING --#TIMEINDEX 100 --#STATE OPERATIONAL --#HELP "scsismrt.hlp" --#HELPTAG 124 ::= 124 sCSISmart21 TRAP-TYPE ENTERPRISE cyclone DESCRIPTION "Aspi: database is corrupted" --#TYPE "Aspi: database is corrupted" --#SUMMARY "ASPI: database file is corrupted" --#ARGUMENTS {} --#SEVERITY WARNING --#TIMEINDEX 100 --#STATE OPERATIONAL --#HELP "scsismrt.hlp" --#HELPTAG 125 ::= 125 sCSISmart12 TRAP-TYPE ENTERPRISE cyclone VARIABLES {cycHostAdapterNumber, cycScsiTargetID, cycLun, cycVendor, cycProduct, cycSenseInfo} DESCRIPTION "The HostAdapter# %d, TargetID %d, Lun# %d has Predictive Failure Condition on vendor %s product %s with sense info MSB(sense code), next 8 bits (sense code Qual) next 8 bits (Add sense code Qual) LSB (0000) %d" --#TYPE "Device has SMART/Predicictive failure event" --#SUMMARY "The HostAdapter# %d , TargetID %d, Lun# %d has Predictive Failure Condition on vendor %s product %s with senseinfo %d" --#ARGUMENTS {0,1,2,3,4,5} --#SEVERITY INFORMATIONAL --#TIMEINDEX 100 --#STATE OPERATIONAL --#HELP "scsismrt.hlp" --#HELPTAG 116 ::= 116
CODE
sed/grep/awk (something that deletes from first line to ::= xxx(a random number))
OUTPUT
sCSISmart21 TRAP-TYPE ENTERPRISE cyclone DESCRIPTION "Aspi: database is corrupted" --#TYPE "Aspi: database is corrupted" --#SUMMARY "ASPI: database file is corrupted" --#ARGUMENTS {} --#SEVERITY WARNING --#TIMEINDEX 100 --#STATE OPERATIONAL --#HELP "scsismrt.hlp" --#HELPTAG 125 ::= 125 sCSISmart12 TRAP-TYPE ENTERPRISE cyclone VARIABLES {cycHostAdapterNumber, cycScsiTargetID, cycLun, cycVendor, cycProduct, cycSenseInfo} DESCRIPTION "The HostAdapter# %d, TargetID %d, Lun# %d has Predictive Failure Condition on vendor %s product %s with sense info MSB(sense code), next 8 bits (sense code Qual) next 8 bits (Add sense code Qual) LSB (0000) %d" --#TYPE "Device has SMART/Predicictive failure event" --#SUMMARY "The HostAdapter# %d , TargetID %d, Lun# %d has Predictive Failure Condition on vendor %s product %s with senseinfo %d" --#ARGUMENTS {0,1,2,3,4,5} --#SEVERITY INFORMATIONAL --#TIMEINDEX 100 --#STATE OPERATIONAL --#HELP "scsismrt.hlp" --#HELPTAG 116 ::= 116
So you see only first part of the file has been deleted.Later I can put this in a LOOP so that I delete one paragraph at a time.
ALSO each file is separated by a blank link, So you could also tell me something that deletes from first line to the first blank line it encounters.