strip numbers from filenames
-
- Posts: 1
- Joined: Tue Aug 09, 2022 2:12 pm
strip numbers from filenames
Does anyone know if there is a way in FFAStrans to take numbers from file names for example 14562_nomedoarquivo.mxf
Re: strip numbers from filenames
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:
Replace numbers only from start in the original filename, e.g. filename is 123a1b1c123, result is a1b1c123:
Replace numbers only between _, e.g. filename is test_123_test, result is testtest:
Replace numbers only from end of filename and keep original extension: e.g. test123.png -> test.png:
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.
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+")
Code: Select all
$regreplace("%s_original_name%","^\d+")
Code: Select all
$regreplace("%s_original_name%","_\d+_")
Code: Select all
$regreplace("%s_original_name%","^\d+") & ".%s_original_ext%"
emcodem, wrapping since 2009 you got the rhyme?