Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a folder with a few hundred PDF files and would like to sort them to various other folders according to selected words in each PDF title.
The unsorted PDF folder is
C:\PDF
The destination folders are (for example):
D:\PDF\MATH
D:\PDF\ENGLISH
D:\PDF\GEOGRAPHY
D:\PDF\BIOLOGY
D:\PDF\CHEMISTRYThe words used for searching every PDF title (filename) would obviously be: math, english, geography, etc. If there's more than one way of doing this, I'd be interested to know.
thanks

There are multiple ways to do this, here is probably the easiest(in my opinion):
pushd c:\pdf for %%a in (MATH ENGLISH GEOGRAPHY BIOLOGY CHEMISTRY) do ( move "*%%a*.PDF" "%%a" ) popd

@ Judago
Wow, thanks it works great, it took just a couple of minutes to sort through 1,200 Pdfs. I had to create the destination folders first in C:\PDF
I'd been trying to find a solution from XP's command prompt but not having much success.
thanks again
EDIT
I afterwards came across the util (copyright 2000, cooltools), xmove.exe, which uses the syntax
XMOVE source_dir file_pattern destination_dir [modifiers]
by using the wildcard * before a word, after a word and either side of the word, all files whose filename contains that word can be moved to another folder:
xmove C:\PDF math* C:\MATH
xmove C:\PDF *math C:\MATH
xmove C:\PDF *math* C:\MATHWhether copy, move, xcopy, xxcopy, robocopy have a similar ability to deal with wildcards, I'm not sure.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |