in reply to modifying the search pattern of a file.
perl -i -pe 's/(<% INCLUDE file)(1|2)(\.txt %>)/$1 . ($2 == 1 ? 2 : 1) + . $3/eg' index.txt [download]
*Woof*