input_file1: text1 text2 text3 input_file2: #some stuff and more text #this is the second line... and this is what I want to end up with: text1.txt: #this file was autogenerated for text1 using input_file2. #some stuff and more text #this is the second line... input:text1 input:text2 input:text3 text2.txt: #this file was autogenerated for text2 using input_file2. #some stuff and more text #this is the second line... input:text1 input:text2 input:text3 text3.txt: #this file was autogenerated for text3 using input_file2. #some stuff and more text #this is the second line... input:text1 input:text2 input:text3