There’s a script called “compsfromspreadsheet” on aescripts.com that does that. You just fill in the filenames and text, etc. on the spreadsheet and it replaces everything and creates new comps from your template comp. I’ve used it a few times and it works great, but you have to be careful about spelling, capitalization, etc. because it will stall on any errors.