strip numbers from filenames

Use this forum to request features. Maybe you'll get lucky!
Post Reply
MOISES_LOPES
Posts: 1
Joined: Tue Aug 09, 2022 2:12 pm

strip numbers from filenames

Post by MOISES_LOPES »

Does anyone know if there is a way in FFAStrans to take numbers from file names for example 14562_nomedoarquivo.mxf
emcodem
Posts: 1646
Joined: Wed Sep 19, 2018 8:11 am

Re: strip numbers from filenames

Post by emcodem »

Hi Moises,

welcome to the forum and thank you for using FFAStrans!

Thats easy, use a populate processor, create a new user variable and select your new variable on the left side in the dropdown.
On the right side, you enter some regex, a few examples:

Replace ALL numbers in the original filename, e.g. filename is 123a1b1c123, result is abc:

Code: Select all

$regreplace("%s_original_name%","\d+") 
Replace numbers only from start in the original filename, e.g. filename is 123a1b1c123, result is a1b1c123:

Code: Select all

$regreplace("%s_original_name%","^\d+") 
Replace numbers only between _, e.g. filename is test_123_test, result is testtest:

Code: Select all

$regreplace("%s_original_name%","_\d+_")
Replace numbers only from end of filename and keep original extension: e.g. test123.png -> test.png:

Code: Select all

$regreplace("%s_original_name%","^\d+") & ".%s_original_ext%"
At the end, you can then use a deliver processor and play with "drop original name" (and extension, depending on what regex you choose) and insert your newly created and populated user variable in the prefix field. If your workflow only does renaming, also check the "move instead of copy" field and set %s_original_folder% as target folder.
emcodem, wrapping since 2009 you got the rhyme?
Post Reply