#1 2010-06-17 07:36

iycgtptyarvg
Member
Registered: 2009-07-30
Posts: 24

How do I remove string starting with 'The '?

I have file names which start with 'The ', and I want to remove them.
Unfortunately, I don't know how.

Examples:

"The quick brown fox" -> "quick brown fox"
"Jumped over the lazy dog" -> "Jumped over the lazy dog"
"The the dog" -> "the dog"

So, only the starting 'the ' has to be removed, but none of the other occurrences.

Thanks in advance.

Offline

#2 2010-06-17 10:05

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

Re: How do I remove string starting with 'The '?

Hi iycgtptyarvg, welcome.

>> "only the starting 'the ' has to be removed"
FROM:
The quick brown fox
Jumped over the lazy dog
The the dog
TO:
quick brown fox
Jumped over the lazy dog
the dog



Try this RegEx Rule:
Expression: ^the (.*)
Replace: $1

Explanation:
find "the " and then the rest, but only if this "the " is at start of the string (^),
then replace with them found between the () parentheses.



Side note:
With ReNamer even this works:
Try this RegEx Rule:
Expression: ^the~
Replace:

where instead the ~ -sign insert an blank here.





See the WIKI for more about this:
=> http://www.den4b.com/wiki/ReNamer:Rules for more about using Rules and
=> http://www.den4b.com/wiki/ReNamer:Regular_Expressions for more about the RegEx Syntax.

HTH?   big_smile
If yes spread the word about ReNamer ... and help two others too.


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 2010-06-17 11:40

iycgtptyarvg
Member
Registered: 2009-07-30
Posts: 24

Re: How do I remove string starting with 'The '?

Yes, this works!

Many, many thanks. This will save me a TON of manual renaming!

Offline

Board footer

Powered by FluxBB