5

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 comment's thread
view the rest of the comments
[-] BobTheDestroyer@lemy.lol 1 points 8 months ago

Oh I see. I thought only .txt files are text files.

I was trying to adjust the code so that it uses a .txt file instead of a .csv file.

this post was submitted on 28 Mar 2024
5 points (100.0% liked)

Programming

10 readers
55 users here now

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.

founded 2 years ago
MODERATORS