Copy and rename files using a CSV with Powershell
completely new , trying run simple script take source file , copy\rename new location.
sample csv:
orginalfilename,newfilename
g:\academy\client images\374.jpg,e:\images_renamed\t00002us01_374.jpg
g:\academy\client images\374-1.jpg,e:\images_renamed\t00002us02_374-1.jpg
script:
import-csv e:\scripts\copyimg.csv -delimter "," | % { copy-item -path $_.orginalfilename -destination "e:\images_renamed\$($_.newfilename)
error:
copy-item : given path's format not supported.
@ line:1 char:54
any point me in correct direction help. thanks!
ugh, figured out! care, following worked.
import-csv e:\scripts\copyimg.csv | % { copy-item -path $_.orginalfilename -destination "$($_.newfilename)" }
Windows Server > Windows PowerShell
Comments
Post a Comment