BEGIN{ styles=0 in_style=0 rows=-1 } { 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,"^ *