jiqimaogou
1/21/2020 - 3:35 AM

SED delete specific lines between two patterns?

SED delete specific lines between two patterns?

awk '
/BEGIN:VEVENT/ { inBlock = 1 }
inBlock {
    if ( /END:VEVENT/ ) {
        inBlock = 0
    }
    else if ( /^(UID|SEQUENCE)/ ) {
        next
    }
}
{ print }
' file