Need to search for multiple values and copy the findings to a folder.

I have a file with 10000 values. I need to search for these values on a Server folder and once found, need to copy the
file to another folder. The values to search for are in one column in a spreadsheet. Values attached. They are PDF's.

How can I accomplish this?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jose Gabriel Ortega CastroCEOCommented:
OK working with Excel spreadsheet is complicated
because you would need to create a COM object then open the book, search the workbook and get the whole columns until they are empty.

I'd suggest to just open the excel file with ms excel and save it as "CSV (windows)". you would get something like the file attached it.
Also, you need to expand your question to add the "source" and the "target" paths, and what is the "SEARCH criteria" in the source path, if it's gonna be recursive or not.

Then save this into a file with extension .ps1 (ex: script.ps1)
$invocation = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$CsvFile = $invocation + '\Book1.csv'

Import-Csv $CsvFile | %{
  #Searchlogic and findings
    $_."Original PO #"

#Copy Logic

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
So, the files to be search and (conditionally) moved are PDFs?
maximus1974Author Commented:
Yes, they are PDF.

Source: \\ntapp\Z_ACCT\Z_CERTS\CERTS\Purchase_Orders_Certs
Destination: C:\LOT_SALE_ARO
Search criteria: All files that match the values in the list  

However, there are times where the files have a suffix of A, B, C, etc...
Ex. 2050496, 2050496A, 2050496B, 2050496C, etc...

I would like to copy all files starting with the value in the list to the destination.
are you searching the content of the PDFs or the file name of the PDFs?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.