for-i-repeat

I just finished developing a small tool called for-i-repeat that can duplicate a text-fragment a number of times using a counter. The reason I needed this is for the following scenario: at work we have a machine that has 50 databases that all have the same schema, but different data. If I want to modify the schema of all 50 databases, I create a SQL script that applies the modifications to 1 database, put USE Database01 in front of it, and run it 50 times, each time modifying the USE-statement with the next database number. for-i-repeat allows me to convert this input:

USE Database{0:00}
ALTER TABLE …

into this output:

USE Database01
ALTER TABLE …
USE Database02
ALTER TABLE …
USE Database03
ALTER TABLE …
…
USE Database50
ALTER TABLE …

A real time-saver! To format the counter {0}, you can use the full range of .NET numeric formatting options, including hexadecimal formatting ({0:X}).

You can download it from Box.