rem for each line is the csv file, expand the template.txt file, replacing the %0 %1 etc markers in template.txt rem with the contents of the corresponding field. Template.txt may contain more than one line. rem glue the results together and write them to somefile.txt java.exe com.mindprod.csv.CSVTemplate somefile.csv template.txt rem The output will appear in a file with the same name as the input rem with the same extension as the template file, in this case somefile.txt