swap all the words on a folder

A swapping-ground for Regular Expression syntax

swap all the words on a folder

Postby Nicko87 » Tue Oct 16, 2018 2:10 pm

Hello and first of all congratulations for that amazing tool and the whole support on the forum!
As a junior system admin i am on a task that kinda confuses me and i'd be grateful for some help!
I have to rename many folders which they are on the format id_day_month_year and they should be on the format year_month_day_id
For example this folder 1862_13_05_1988 should be renamed like 1988_05_13_1862.
Like this are several ones folders.

Additionally i'd like to ask if its possible the same time that i am renaming on that new format all these folders if the files that exist inside the folders (each file (.tiif) with the same name of its folder) to change also name.

A note also that when i am trying any kind of attribute to the regex(1) match field i am getting red field
Thank you in advance
Nicko87
 
Posts: 2
Joined: Tue Oct 16, 2018 2:04 pm

Re: swap all the words on a folder

Postby therube » Wed Oct 17, 2018 1:58 am

1:RegEx
Code: Select all
Match:  ^(\d\d\d\d)_(\d\d)_(\d\d)_(\d\d\d\d)$
Replace:  \4_\3_\2_\1
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: swap all the words on a folder

Postby Nicko87 » Thu Oct 18, 2018 4:08 pm

Thank you!!It worked like a charm!! <3 However it just renamed the folder. If the folder has 1 or 2 files (pdf or tif - i hope their format doesnt matter anyway - ) of the same format that they should renamed also the same? is there a way to apply this rename filter on the files inside of a folder?
Nicko87
 
Posts: 2
Joined: Tue Oct 16, 2018 2:04 pm


Return to Regular Expressions