Rename files (regular expression grrrrrrr !)


i want to rename files seem like that : 20051205654231564.jpg (year)(month)(day)(many number).(extension)
i want to create button to hjave this format : 2005-12-05-654231564.jpg

Somebody can help me ? if possible i would like button code AND screenshot of Rename dialog. because i want to learn the 2 solutions...

There are not a tuto for renaming files ?


It's OK !!!!!!!!!!!!!!!!!

Rename REGEXP PATTERN="(....)(..)(..)(.*).(.jpg)" TO="\1-\2-\3-\4\5

I forget the "." in (.*)

but another problem if i write Rename REGEXP PATTERN="(....)(..)(..)(.).(.)" TO="\1-\2-\3-\4\5

Extension lost last digit... why ?

It's because the extra . near the end (outside the brackets) is swallowing one character.

This version fixes that and works with any 3-letter extension. It also escapes the dot in the extension.

From: (....)(..)(..)(.*)(....)
To: \1-\2-\3-\4\5

another remane file...

I have files with 3 element...

(1) -> J????????? (where ? are number)
(2) -> A? (where ? are number)
(3) -> m? (where ? are number)
(4) -> "_" (

files example : J669668000__m4_A0__.tif or J669668000__A0_m4_.tif or A0_m4_J669668000.tif

i want to rename all files like that : (1)(4)(4)(4)(2)(4)(4)(3)(4)(4).tif (A0_m4_J669668000.tif -> J669668000___A0__m4__.tif

it's possible ?

Easiest way it to have a button which does six renames with each rename matching one of the permutations of (J,a,m)

Sorry but i don't understand... :question:

Six renames which do this:

Rename Jam -> Jam
Rename Jma -> Jam
Rename mJa -> Jam
Rename maJ -> Jam
Rename aJm -> Jam
Rename amJ -> Jam

So for each rename you'd have a regular expression that matches just one permutation and produces a result in the order you want (Jam).