I have a script that duplicates a Word doc template and renames each using a csv file with a list of names. What would be the equivalent code if instead of a csv file I use a text file?

Import-csv ‘.\individuals2.csv’ | foreach-object {
	$newname = ‘2 ‘ + $_.name + '.docx’
	Copy-item '.\template.docx' $newname
}
You are viewing a single thread.
View all comments View context
1 point
*

The confusion is that CSV is also just a Notepad text file that uses Commas to Separate Values.

They are asking about what kind of values are in it.

permalink
report
parent
reply
1 point

Just words? It’s a list of names.

permalink
report
parent
reply

Programming

!programming@beehaw.org

Create post

All things programming and coding related. Subcommunity of Technology.


This community’s icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

Community stats

  • 67

    Monthly active users

  • 235

    Posts

  • 1.5K

    Comments