BobTheDestroyer

joined 7 months ago
[–] [email protected] 1 points 7 months ago (1 children)

Thanks but PS closes so I assume it ran into an error. I'm not sure why because there is the same number of files and list items. I doublechecked to make sure.

[–] [email protected] 1 points 7 months ago (6 children)

Also I had someone help with a similar task of duplicating a Word file that is renamed from a list of names found in a csv file. What would be the code when a txt file is used?

Import-csv ‘.\individuals.csv’ | foreach-object {
    $newname = ‘2’ + $_.name + '.docx’
    Copy-item '.\_2023 Summary Page.docx' $newname
}
[–] [email protected] 1 points 7 months ago

Yeah it's a pretty simple task and I'm interested in getting more familiar with PS.

[–] [email protected] 1 points 7 months ago (6 children)

Thanks but I'm getting a 'Cannot create a file when that file already exists.' error. I checked the path so I am certain it is correct.

[–] [email protected] 1 points 7 months ago
[–] [email protected] 1 points 7 months ago (15 children)

Perhaps my directions were unclear. The Excel/CSV file has the new names and I want to use them to replace the default names for the PDF files.

[–] [email protected] 2 points 7 months ago

I got rid of that task. Now it's just Task #1

[–] [email protected] 1 points 7 months ago
[–] [email protected] 2 points 7 months ago

Nevermind I got it!

[–] [email protected] 1 points 7 months ago (1 children)

Actually nevermind that question. Just realized the command was split.

I'm assuming I need to replace the name portion of the 2nd line. What do I input if the data is a list that starts in A1?

[–] [email protected] 1 points 7 months ago (2 children)

So I'm new to all this. When I enter the first command with my csv file and doc file included, it just opens the word doc. Wasn't sure what I should do next.

[–] [email protected] 1 points 7 months ago (1 children)

Sorry I'm new to this. What exactly do I enter into Powershell for each step?

view more: ‹ prev next ›