How to remove everything after a _

Advanced Renamer forum
#1 : 22/02-22 14:22
Stavros
Stavros
Posts: 3
Example: 3DPool_v1.2_0621
to become 3DPool

or Academy_v1.1
to become Academy

Is there a way to do it?


22/02-22 14:22
#2 : 22/02-22 15:54
Joel de Bruijn
Joel de Bruijn
Posts: 27
Reply to #1:

Open Notepad
Paste text below
Save as example.aren
Open with Advanced Renamer.

Explanation: Use Remove Pattern, turn on RegEx, look for _ and everything after that (.+)
-------------------------------------------------------------------
[header]
type=preset
application=Advanced Renamer 3.88
application_version=3880100
batchmode=rename
pairrename=1

[namecollision]
separator=_
pattern=
rule=fail

[methods]
method0000=methodname:"removepattern"; active:"1"; pattern:"_.+"; casesensitive:"0"; regularexpressions:"1"; applyto:"name";



22/02-22 15:54
#3 : 22/02-22 20:01
Stavros
Stavros
Posts: 3
Reply to #2:
I am new to this type of programms. I copied the text (everything under the line) and saved it. Open it with advanced renamer and i saw it has a remove pattern method like this, _.+
Is this correct?

Also how do i turn on Regex and how do i look for _ and everything after that (.+)

(edit)
I found it, i just had to open it and run the batch. Thank you so so much. Never would have found it.

Can you also please help me remove a <space> after a name of a file?
Example Cars - Mater-National Championship<space>.mp4
to this Cars - Mater-National Championship.mp4
the space bar is maybe one time pressed after the name or two or sometimes three.
how can i correct them?

Thank you for your time. :)


22/02-22 20:01 - edited 22/02-22 20:16
#4 : 22/02-22 20:26
Joel de Bruijn
Joel de Bruijn
Posts: 27
Reply to #3:

Create AREN file with:
[header]
type=preset
application=Advanced Renamer 3.88
application_version=3880100
batchmode=rename
pairrename=1

[namecollision]
separator=_
pattern=
rule=fail

[methods]
method0000=methodname:"trim"; active:"1"; characters:" .,_-"; applyto:"name"; casesensitive:"0";

Cheers!


22/02-22 20:26
#5 : 22/02-22 20:27
Joel de Bruijn
Joel de Bruijn
Posts: 27
Reply to #4:

Found a way to share screenshots, easier than editing aren files manually.
Although I used it to create them with 100 methods or so. ;)

https://pic.li/i/GWs4


22/02-22 20:27
#6 : 22/02-22 21:23
Stavros
Stavros
Posts: 3
Reply to #5:

Again, your code did the trick. I would never had done this without your help. Thank you very much for your time to answer my questions. :)

I keep those files for future use. :) :)


22/02-22 21:23