purplemonkeymad@programming.devtoProgramming@programming.dev•Powershell: Create multiple files from a Word template and rename using a list in Excel/CSV
2·
9 months agoFor csv import, use import-csv and loop on the results:
Import-csv myfile.csv | foreach-object {
Templates should be easy, just copy the template to a new file with the docx extension. Use one of the columns (in this case “name” as the column header,) from the csv for the name:
$newname = $_.name + '.docx'
Copy-item 'template.dotx' $newname
}
Make sure the columns in your csv are named properly, my code assumes it’s named just “name”