1. How can I use powershell to move all files in 1 folder that have "_CLM_" in the file name (on network server)
2. How can I use powershell to move a csv list of files from 1 directory to another? (if they are in different folders within 1 directory... and also on a network server)
Powershell
Last Comment
Brent Guttmann
8/22/2022 - Mon
oBdA
1. Similar to moving tif files, just with a different filter:
2. The basic command to read a csv file is "Import-Csv -Path C:\Temp\SomeFile.csv"; this will get you an array of objects with the column names as properties, provided the csv file has a header line. If it doesn't, you need to provide the -Header argument to let PS know about the column names.
It's unclear what you want to do - does the csv file have a source and target column for each individual file, or just a source and you want all files to go under a common target location? And if the latter, do you want to "flatten" the source subfolder structure (and if so, what is supposed to happen with duplicate names), or keep it in the target?
Hi, when I tried testing this, after I pasted the code into powershell and pressed enter it just went to the next line, which read ">>" and thats it.... nothing happened. What am I doing wrong?
Open in new window
2. The basic command to read a csv file is "Import-Csv -Path C:\Temp\SomeFile.csv"; this will get you an array of objects with the column names as properties, provided the csv file has a header line. If it doesn't, you need to provide the -Header argument to let PS know about the column names.
It's unclear what you want to do - does the csv file have a source and target column for each individual file, or just a source and you want all files to go under a common target location? And if the latter, do you want to "flatten" the source subfolder structure (and if so, what is supposed to happen with duplicate names), or keep it in the target?