My vbs and powershell skills are very limited but i've been tasked with something i need some help on. The as is following.
I have folder called C:\temp\pdf, this folder contains approx 20,000 pdf files. In the same folder i have a text file (.txt) with 3000 lines. Each line has just an ID number like 12345, next line 45678, next line 59385 etc... I need a way to scan the content of all 20,000 files and when the ID matches copy the file into another folder. At the end i'll have a new folder with 3000 files. Unfortunately i can't install any .dll files and have to use vbs, powershell or cmd to do this task.
Thank you in advance for your help.
Asked
Active
Viewed 49 times
-1

Veebster
- 71
- 8
-
3Windows doesn't have any built-in PDF-scanning/searching functionality, so you really won't get anywhere with your current constraints :) are you allowed to upload your pdf files to some service on the internet to scan them for you? – Mathias R. Jessen Jul 12 '23 at 15:06
-
Take a look at https://stackoverflow.com/questions/29217557/find-specific-sentence-in-a-web-page-using-powershell You could try invoking the PDF as a Web Page (`file:///C:/temp/pdf/file1.pdf`) in a Browser and see if you can search it that way. – Twisty Jul 12 '23 at 19:17
-
2Does this answer your question? [How to search in PDF files and move them using powershell](https://stackoverflow.com/questions/57925530/how-to-search-in-pdf-files-and-move-them-using-powershell) – LesFerch Jul 15 '23 at 16:50
1 Answers
-1
If you have MS Word, you can open/convert the PDF files in MS Word then do the reading of each line in MS Word while traversing each row of your txt file and comparing it.

user22240154
- 1
- 1
-
As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 24 '23 at 20:09