BEGIN{ styles=0 in_style=0 rows=-1 in_cell=0 } { if(match($0,"^ *]")){ if(rows<4)rows++ } # if(rows>-1){ # if(rows<4) # gsub(" ss:StyleID=\"\\w+\""," ss:StyleID=\"s1\"",$0) # else # gsub(" ss:StyleID=\"\\w+\"","",$0) # } # if(match($0,"^ *")){ in_style=0 if(styles>2 )next } if(in_style && styles>2 )next print $0 }