You are not logged in.
Pages: 1
I'm after renaming a file from, i know the '/' shouldnt exist in a filename but for the sake of the argument please help
wibble/rss/acg
to
heros/rss_acg/acg
the 'acg' part changes ie it can be anything and any length but always at the same place of the name and needs to end up at the same place in the result twice.
the 'rss' and 'rss_' is the same every time
the first part can be a simple replace 'wibble/rss' for 'heros/rss_'
but then i get stuck ...
Last edited by thej0ker (2025-08-15 00:17)
Offline
Oh I forgot to say the maybe more '/' earlier in the name..
Offline
It looks likes you are trying to duplicate the part after the last delimiter so that it also appears before the last delimiter. Is that correct?
You can try this Regular Expressions rule: Replace expression "(.*)/(.*?)\Z" with "$1_$2/$2".
Input filename: wibble/rss/acg
Output filename: wibble/rss_acg/acg
Perhaps few real examples could better demonstrate what you are trying to do.
Offline
I forgot to add the the input needs to find wibble first as it could be anything so examples are
Input
wibble/rss/acg
fred
bob/bob
wibble/rss/qwerty
Output
wibble/rss_acq/acg
wibble/rss_qwerty/qwerty
With the two in the middle being ignored..
I have tried
^wibble.*(.*)/(.*?)\Z
$1_$2/$2
Help please
Offline
Replace expression "\A(wibble/.*)/(.*?)\Z" with "$1_$2/$2".
Offline
Pages: 1