extracting subfolder structure from filename

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

extracting subfolder structure from filename Wed Jun 15, 2016 5:49 am • by mcwolfe
Hi there!

So, I have a number of files with a file name structure like this course_assignment.ext. Now, I would like to sort into subfolders so that I have

course_1
ass_1
ass_2
course_2
ass_1
ass_1

etc. In other words, I want to be able to extract parts of the filename and use that to build the subfolder structure.

Actually, come to think if it, it would be enough to just extract the first part, so that all files are sent to a subfolder "course".

Is that possible?

Kind regards
Ulf
mcwolfe
 
Posts: 2
Joined: Wed Jun 15, 2016 5:44 am

Yes, look up "match patterns" in the help.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Yes, look up "match patterns" in the help.


Yupp, found it after some more searching here (and didn't get around to post an update). Was easier than I thought (and waaay more powerful :-) ).

Kind regards
Ulf
mcwolfe
 
Posts: 2
Joined: Wed Jun 15, 2016 5:44 am


Return to Support

cron