0

I need to populate a bunch of folders with files of various types. The destination folder structure is as follows

YEAR > COMMITTEE_NAME YEAR > YEAR MONTH COMMITTEE_NAME

EX: 2015 > ADP 2015 > 2015 January ADP

The files to be moved are in folders by committee (MOM, ADP, etc). I have to organize first by year, then by committee, then by month.

Each folder contains files of various types named by the date and committee (Ex: A Word Document from the ADP meeting of Jan 22, 2015 would be "012215ADP.doc").

I would like to somehow automate the populating of these folders as there are hundreds if not thousands of files to move. My only programming experience is in MATLAB, which I am proficient in, but am not allowed to use due to corporate rules. I know how to execute and modify .bat files, but do not know enough to make them.

1
  • Not really a good case for using windows batch. Would be better using a dedicated renaming tool such as "Advanced Renamer" or PowerShell or maybe windows scripting host. Can you install apps or get them installed by IT? That would be the simplest and most reliable way without having to learn a new computer language. Jun 19, 2015 at 21:11

1 Answer 1

0

This can only be done with a power shell script and a regular expression.

PS C:\Users\bongioc> dir | where {$_ -match "(\d{2})(\d{2})(\d{2})([A-Z]{3}).*.doc"} | foreach {move $matches[0] $matches[3]\\$matches[4]\\$matches[1] }

Now, I am a linux guy and I don't have time to fudge this more, but the spaces in your name and the fact you want

01 -> January

Will complicate things; you need to quote arguments and escape others (and on this platform I am not sure how) If you're not wedded to that structure, you can do a directory structure like this easy enough:

15/ADP/01/1501ADP.doc

The capture groups are

  1. file name $matches[0]
  2. month $matches[1]
  3. day $matches[2]
  4. year $matches[3]
  5. group $matches[4]

Best I can give you for now. You may need to install powershell on windows 7.1

You must log in to answer this question.

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