0

I have over 1000 pdfs that I need to move to their own folders. The pdfs are named "TRR 0000.pdf", where the 0000 changes, but the TRR always remains the same. So "TRR 0000.pdf" needs to move to the folder "0000". The folders have already been created and I just need an efficient way to transfer the pdfs to their corresponding file.

2
  • Yes this is possible with powershell. Commented Sep 1, 2022 at 21:28
  • Ive never used powershell, so could you possibly tell me how to do this in powershell? I would greatly appreciate it. Commented Sep 1, 2022 at 21:52

1 Answer 1

1

Try the following in PowerShell:

$files = Get-ChildItem -Filter "*.pdf"
foreach ($file in $files) {Move-Item $file -Destination $file.BaseName.Split(" ")[-1]}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .