open IN,") { if (/-----------step [\d]\./){ $step_num ++; s/-----------step \d\./-----------step $_\.$step_num/; } } close IN;