perl -i -pe 's/(<% INCLUDE file)(1|2)(\.txt %>)/$1 . ($2 == 1 ? 2 : 1) . $3/eg' index.txt