I need a powershell script which compare the name in a txt file. In the txt file have only digits. For example:
345
789
3256718
5629
etc.
I have a directory in which have a different type a file (.jpg, psd, gif usw) and the name begin always with digit. For example:
543_Nature…jpg
5629_Mountain_Valley.tif
etc.
I need a powershell script which compare the name (only digit). When found match ignore the file, when the digits not exist in the name, then copy file in other directory.
You are member of this forum for long enough to know that we will not write ready to use ocde on request. So what’s your actual question here? Please share your code.
.
If you don’t know how to start you may (re-)read the help for the following cmdlets to get some ideas how to approach this task:
123
23267
23911
411
456
646232
673574
673574
This are the digit in the name the fie
123.txt
23267.docx
23911.pptx
411_ivo.xlsx
456.pub
646232.bmp
673574.docx
673574_nature.docx
I want to move all file that not match the digit in the name with my list in other directory.
I hope that i am clear.
This move all file. I need to compare the name of file in C:\User\Administrator\Desktop. The begin always with digit. If the name contains a number in my list to be ignored, otherwise it will be moved to a new directory.
Thank you again.
It appears you could have a typo with your input list in your later code compared to your earlier code. So then nothing would match and everything gets moved? But there would be an error message, so you probably know that.