#1 2019-01-22 03:01

jeffli
Member
From: den4b.com
Registered: 2019-01-22
Posts: 14
Website

Remove English characters from the middle of two sets of numbers?

Hi and thank you for this incredible program, very useful.

My issue is this : Remove English characters from the middle of two sets of numbers
For example:"2019-1-22 ground tube 001.docx”
my goal:"2019-1-22 001.docx”


Is there an easier way to do it?
Thanks in advance


Jeff

Offline

#2 2019-01-22 15:16

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

Re: Remove English characters from the middle of two sets of numbers?

Hi and welcome!

Sounds like Strip rule
http://www.den4b.com/wiki/ReNamer:Rules:Strip

could be what you're looking for?



 


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 2019-01-22 15:33

jeffli
Member
From: den4b.com
Registered: 2019-01-22
Posts: 14
Website

Re: Remove English characters from the middle of two sets of numbers?

Stefan wrote:

Hi and welcome!

Sounds like Strip rule
http://www.den4b.com/wiki/ReNamer:Rules:Strip

could be what you're looking for?

Hi Stefan,
Thank you.
Maybe my example is inappropriate, i want to do this:
origin file name:

  1. 0.0014 inch precision ground tube 0.0014 inch ground tube.docx

  2. 0.0018 inch raw tube 0.0018 inch tube.docx

  3. HX outer package box HX package box.docx

  4. ...etc.

rename to:

  1. 0.0014 inch precision ground tube.docx

  2. 0.0018 inch raw tube.docx

  3. HX outer package box.docx

  4. ...etc.

It is a little difficult to use Strip rule.

Last edited by jeffli (2019-01-22 15:42)


Jeff

Offline

#4 2019-01-22 15:37

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

Re: Remove English characters from the middle of two sets of numbers?

We need to find an common "anchor point".
So. always remove from the second found number till the end?



 


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

#5 2019-01-22 15:44

jeffli
Member
From: den4b.com
Registered: 2019-01-22
Posts: 14
Website

Re: Remove English characters from the middle of two sets of numbers?

Stefan wrote:

We need to find an common "anchor point".
So. always remove from the second found number till the end?
 

for example:

  1. "0.0018 inch raw tube 0.0018 inch tube.docx" rename to "0.0018 inch raw tube.docx"

  2. "HX outer package box HX package box.docx" rename to "HX outer package box.docx"

I always remove words from second "0.0018" or "HX".


Jeff

Offline

#6 2019-01-22 16:43

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

Re: Remove English characters from the middle of two sets of numbers?

Try that:


FROM:
0.0014 inch precision ground tube 0.0014 inch ground tube.docx
0.0018 inch raw tube 0.0018 inch tube.docx
HX outer package box HX package box.docx

TO:
0.0014 inch precision ground tube.docx
0.0018 inch raw tube.docx
HX outer package box.docx

USE:
Regular Expressions (http://www.den4b.com/wiki/ReNamer:Rules:RegEx)

Expression "^(.+)#(0\.|HX).+$"
Replace with "$1"
(skip extension), maybe check (case-sensitive) too


NOTE: instead of hash-sign #, enter a blank space.




Explanation:
^ >>>>>> Start at the beginning
(.+) >>> Match one-ore-more of any sign and capture for re-use, untill...
#(0\.|HX).+$ >>>> Space, followed by 0. or HX and the rest till the end
$1 >>>> Replace whit what was captured by first (...) capture group

See http://www.den4b.com/wiki/ReNamer:Regular_Expressions   for more....



works?


 


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 2019-01-22 16:55

jeffli
Member
From: den4b.com
Registered: 2019-01-22
Posts: 14
Website

Re: Remove English characters from the middle of two sets of numbers?

Stefan wrote:

Try that:


FROM:
0.0014 inch precision ground tube 0.0014 inch ground tube.docx
0.0018 inch raw tube 0.0018 inch tube.docx
HX outer package box HX package box.docx

TO:
0.0014 inch precision ground tube.docx
0.0018 inch raw tube.docx
HX outer package box.docx

USE:
Regular Expressions (http://www.den4b.com/wiki/ReNamer:Rules:RegEx)

Expression "^(.+)#(0\.|HX).+$"
Replace with "$1"
(skip extension), maybe check (case-sensitive) too


NOTE: instead of hash-sign #, enter a blank space.




Explanation:
^ >>>>>> Start at the beginning
(.+) >>> Match one-ore-more of any sign and capture for re-use, untill...
#(0\.|HX).+$ >>>> Space, followed by 0. or HX and the rest till the end
$1 >>>> Replace whit what was captured by first (...) capture group

See http://www.den4b.com/wiki/ReNamer:Regular_Expressions   for more....



works?


 

Hi Stefan,
It works, thank you for your help, very good Regular Expressio. smile


Jeff

Offline

Board footer

Powered by FluxBB