Help with a regular expression

Advanced Renamer forum
#1 : 20/10-22 22:35
Joao Guilherme
Joao Guilherme
Posts: 1
Hello everybody,

I would like some help to create a regular expression that could rename more than 2000 files I have.
I tried to find it on the forum but I couldn't find an expression that worked.

So I have files with the following structures:

Fornecedor - 2013-03-28 - Chaveiro Chavassi - NF 341.pdf
Fornecedor - 2020-09-12 - Assessoria VOIP - NF 1444 Reparo Cameras.pdf
Fornecedor - 2020-10-15 - AG Brasil - NF 10869.pdf
Fornecedor - 2014-07-17 - Rio Branco Papéis - NF 256195 - Entrega.pdf
Fornecedor - 2014-05-21 - Rio Branco Papéis - NF 249638 - Faturamento.pdf
Fornecedor - 2014-02-13 - Chaveiro Avulso - NF 357.pdf
Fornecedor - 2014-07-17 - Passalaqua Papéis - NF 256195 - Entrega.pdf
Fornecedor - 2014-07-17 - Guajajaras - NF 256195.pdf

I want to be able to move the date to before the text " - NF".
So they end up like this:

Fornecedor - Chaveiro Chavassi - 2013-03-28 - NF 341.pdf
Fornecedor - Assessoria VOIP - 2020-09-12 - NF 1444 Reparo Cameras.pdf
Fornecedor - AG Brasil - 2020-10-15 - NF 10869.pdf
Fornecedor - Rio Branco Papéis - 2014-07-17 - NF 256195 - Entrega.pdf
Fornecedor - Rio Branco Papéis - 2014-05-21 - NF 249638 - Faturamento.pdf
Fornecedor - Chaveiro Avulso - 2014-02-13 - NF 357.pdf
Fornecedor - Passalaqua Papéis - 2014-07-17 - NF 256195 - Entrega.pdf
Fornecedor - Guajajaras - 2014-07-17 - NF 256195.pdf

I've several options but I have no luck.

Any suggestions, Can anyone help me with this difficulty?
Thanks in advance!


20/10-22 22:35
#2 : 23/10-22 22:44
Shioku
Shioku
Posts: 2
Reply to #1:
Replace Method:
Replace: (.* - )(.* - )(.* - )(.*)
With: \1\3\2\4
Activate RegEx


23/10-22 22:44
#3 : 03/11-22 11:48
David Lee
David Lee
Posts: 1125
Reply to #1:

Replace: ( - \d{4}-\d{2}-\d{2})(.*)( - NF)
with: \2\1\3
Use regular expressions


03/11-22 11:48