#1 2020-06-14 17:07

xoksx
Member
Registered: 2020-06-14
Posts: 2

20160810_Amazon-OK-invoice.pdf => Swap, order, rearrange the parts

Hello,

This is the case:
My files have the following naming convention:

YYYYMMDD_COMPANY - OK - Subject.pdf  ==> e.g: 20160810_Amazon - OK - invoice.pdf

I'd like to change that:

Amazon - OK - 20160810 - invoice.pdf


How can I manage this via ReNamer?

Thank you in advance.

Best regards

Last edited by xoksx (2020-06-14 17:08)

Offline

#2 2020-06-14 18:56

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: 20160810_Amazon-OK-invoice.pdf => Swap, order, rearrange the parts

Hi and welcome.

FROM:
20160810_Amazon - OK - invoice.pdf
TO:
Amazon - OK - 20160810 - invoice.pdf

USE:
1) Remove: Remove all "_Amazon - OK" (skip extension)
2) Insert: Insert "Amazon - OK - " as Prefix (skip extension)
3 - [Preview]
4 - [Rename]


For more details see http://www.den4b.com/wiki/ReNamer


HTH?


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#3 2020-06-14 20:14

xoksx
Member
Registered: 2020-06-14
Posts: 2

Re: 20160810_Amazon-OK-invoice.pdf => Swap, order, rearrange the parts

Thank you.
Amazon was just one example.
I have more than 10,000 files with the following naming convention: ==> YYYYYMMDD_COMPANY - OK - Subject.pdf 

So how can I move the date after "OK - "? ==> COMPANY - OK - YYYYYMMDD - Subject.pdf

Offline

#4 2020-06-14 21:21

Rnmr
Member
Registered: 2019-10-22
Posts: 37

Re: 20160810_Amazon-OK-invoice.pdf => Swap, order, rearrange the parts

@xoksx "So how can I move the date after "OK - "? ==> COMPANY - OK - YYYYYMMDD - Subject.pdf"

It is there in Stefan's example.
Did you test/preview it on one of your files?

Step 1 (remove) will cause the date number to be at the beginning all by itself, momentarily.
Step 2 will cause the date to be after 'Company - OK - ...'

Just do each 'step => preview' one-at-a-time.

You would do the same thing for a different company but change the company name (provided they all follow the same format).

However, again, if they follow the same format, you should not be concerned with changing any names/words/numbers/characters/etc.
if you do this:

2 Rules:

First Rule-
Replace (no quotes)

Find
'_'

Replace
' - '

tick 'first' and 'skip extension'

Second Rule- Rearrange (no quotes)

tick 'exact pattern...'

'| | | | | | |'

New Pattern
'$3 $4 $5 $6 $1 $2 $7'

tick 'skip extension'


It also works if you modify the second rule to,
[no qoutes]

tick 'Delimeters'

' - '

New Pattern
$2 - $3 - $1 - $4

tick 'skip extension'



There are probably some other variations but this is a start.
Hopefully I understand you and this helps.

Last edited by Rnmr (2020-06-14 22:18)


To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.
- RWE

Offline

#5 2020-06-14 22:21

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

Re: 20160810_Amazon-OK-invoice.pdf => Swap, order, rearrange the parts

I would do it with a single Rearrange rule, like so:

> Rearrange: Split by exact pattern of delimiters "_", " - OK - ", New pattern "$2 - OK - $1 - $3" (skip extension)

Input:

20160810_Amazon - OK - invoice.pdf
20160810_Another company name - OK - another invoice.pdf

Output:

Amazon - OK - 20160810 - invoice.pdf
Another company name - OK - 20160810 - another invoice.pdf

Assuming that " - OK - " appears in all files.

Offline

#6 2020-06-15 06:15

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: 20160810_Amazon-OK-invoice.pdf => Swap, order, rearrange the parts

xoksx wrote:

Amazon was just one example.

Ahh, now!


Fine, another way to the above mentinoed...

FROM:
20160810_Amazon - OK - invoice.pdf
YYYYYMMDD_COMPANY - OK - Subject.pdf
20160810_Another company name - OK - another invoice.pdf

TO:
Amazon - OK - 20160810 - invoice.pdf
COMPANY - OK - YYYYYMMDD - Subject.pdf
Another company name - OK - 20160810 - another invoice.pdf

USE:
1) Replace rule: Find all "_" Replace " - " (skip extension)
2) Rearrange rule: Split by delimiters " - ", New pattern "$2 - $3 - $1 - $4" (skip extension)
Don't use the "..." quotes, and note the well used spaces.
3 - [Preview]
4 - [Rename]





Or use one Regular Expressions rule to do that all together in one step:
Expression "(\d{8})_(.+? - )(.+? - )(.+)"   Replace "$2$3$1 - $4" (skip extension)



For more details about the rules see http://www.den4b.com/wiki/ReNamer


 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#7 2020-06-15 17:18

Rnmr
Member
Registered: 2019-10-22
Posts: 37

Re: 20160810_Amazon-OK-invoice.pdf => Swap, order, rearrange the parts

@stefan

"USE:
1) Replace rule: Find all "_" Replace " - " (skip extension)
2) Rearrange rule: Split by delimiters " - ", New pattern "$2 - $3 - $1 - $4" (skip extension)
Don't use the "..." quotes, and note the well used spaces.
3 - [Preview]
4 - [Rename]"


Is that another way of doing it or the same as what I suggested?...just curious.


To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.
- RWE

Offline

#8 2020-06-15 20:08

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Re: 20160810_Amazon-OK-invoice.pdf => Swap, order, rearrange the parts

Hi Rnmr,

yes, you have had that exactly same idea already before I posted that,
if I take now a deeper look at your example, I see no differences to mine.
Sorry, I didn't spotted that fact beforehand.





 


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

Board footer

Powered by FluxBB