Generate text file from templates