#1 2023-07-19 18:57

FranciscoOG
Member
Registered: 2023-07-19
Posts: 2

Rearrange or Replace? Parts of words in the filename

Hello,

i've looking up the rearrange and replace section of the documentation, but i dont find any possibility for what i need

example:
initial name : sequenceofcharacternumber1 sequenceofcharacternumber2 sequenceofcharacternumber3.XXX
result : ssequencsequenceofwordnumber3.XXX

concrete example :
initial name : "jonasson wilfriddssen CERT01.pfx"
needed name: "jwilfridsCERT01.pfx"

so i need to
1)replace the first sequence of characters by the first character of the first sequence of characters
2)replace the second sequence of characters by the first 7 characters of the second sequence of characters 
3) leave the third sequence of characters untouched
4) remove all spaces ( i know how to do that part )

ps: the sequence words can go from 3 to to 15 characters long

examples :

bobdylan thundbergmohammed CERT01.pfx
results:bthundberg



thanks in advance,

regards

Last edited by FranciscoOG (2023-07-19 22:16)

Offline

#2 2023-07-19 21:29

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,375

Re: Rearrange or Replace? Parts of words in the filename

That is exactly why the Regular Expressions were invented.

Add a Regular Expressions rule with the following configuration.

Expression:

([^\s])[^\s]*\s+([^\s]{1,7})[^\s]*\s+(.+)

Replace:

$1$2$3

This should convert "jonasson wilfriddssen CERT01.pfx" to "jwilfridCERT01.pfx", as you described.

Offline

#3 2023-07-19 21:40

FranciscoOG
Member
Registered: 2023-07-19
Posts: 2

Re: Rearrange or Replace? Parts of words in the filename

<3 thanks a lot mate <3 i will look right into it

Offline

Board footer

Powered by FluxBB