# Stripping 'THE' from import

**URL:** <https://community.mp3tag.de/t/stripping-the-from-import/47402>\
**Category:** Support\
**Created:** [January 2, 2020, 2:29pm UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402 "2020-01-02T14:29:25Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![flyingmale](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flyingmale/32/8335_2.png) [@flyingmale](https://community.mp3tag.de/u/flyingmale)\
**Post date:** [January 2, 2020, 2:29pm UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/1 "2020-01-02T14:29:25Z")

</div>

Hi.  
I want to retrieve a Text file in Tools to read the contents of a Biography from the parameter: "A://songBiogs/%artist%.txt".  
However, the Biographies are saved without the preceding 'THE', so the above fails when it looks for %THE APPLEJACKS% instead of %APPLEJACKS%. (The Biographies are saved automatically with Foobar2000 using \<$stripprefix(%ARTIST%\>.)  
Can anyone show me how to format it to ignore'THE '?  
Many thanks

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [January 2, 2020, 2:43pm UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/2 "2020-01-02T14:43:21Z")

</div>

I am not quite sure what you do. Is there really a field name

> [@flyingmale](#):
>
> %THE APPLEJACKS%

and you want to use a field called

> [@flyingmale](#):
>
> %APPLEJACKS%

Or do you want to use the contents of ARTIST and it reads "The Applejacks" but you only need "Applejacks"?  
For the first problem I don't know the solution.  
The second can be treated if you use  
`$regexp(%artist%,^The ,)`  
instead of the plain %artist%

---

<div class="post-metadata">

**Author:** ![flyingmale](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flyingmale/32/8335_2.png) [@flyingmale](https://community.mp3tag.de/u/flyingmale)\
**Post date:** [January 4, 2020, 8:48am UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/4 "2020-01-04T08:48:58Z")

</div>

Thanks for this. I adapted your suggestion as best I could ('THE ' is at the beginning of the filename), to search as follows:  
"A://songBiogs/$regexp(^THE %artist%.txt"  
but just got "syntax error"

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [January 4, 2020, 9:06am UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/5 "2020-01-04T09:06:44Z")

</div>

You can test expressions in Convert\>Tag-Tag.  
But even now it would be obvious, that

> [@flyingmale](#):
>
> $regexp(^THE %artist%.txt"

does not very much resemble

> [@ohrenkino](#):
>
> `$regexp(%artist%,^The ,)`

I get, when I use the latter instead of the plain %artist%  
`A://songBiogs/$regexp(%artist%,^The ,).txt`.  
this does not take into account possible other problems like double slashes or slashes instead of backslashes.

---

<div class="post-metadata">

**Author:** ![flyingmale](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flyingmale/32/8335_2.png) [@flyingmale](https://community.mp3tag.de/u/flyingmale)\
**Post date:** [January 4, 2020, 11:20am UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/6 "2020-01-04T11:20:37Z")

</div>

Thanks. I'm not sure I've explained it accurately. The search is for, eg,  
`A://songBiogs/THE BAND.txt`  
but the text file it needs to find is:  
`A://songBiogs/BAND.txt`  
Does that make sense? Cheers for the help!

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [January 4, 2020, 11:56am UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/7 "2020-01-04T11:56:34Z")

</div>

And what does the field ARTIST look like for this example?  
Is it "The Band" or "Band"?  
`A://songBiogs/THE BAND.txt`\> `A://songBiogs/BAND.txt` = `A://songBiogs/$regexp(%artist%,^The ,).txt.`

`A://songBiogs/BAND.txt`\> `A://songBiogs/THE BAND.txt` = `A://songBiogs/THE %artist%.txt.`

---

<div class="post-metadata">

**Author:** ![flyingmale](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flyingmale/32/8335_2.png) [@flyingmale](https://community.mp3tag.de/u/flyingmale)\
**Post date:** [January 4, 2020, 7:56pm UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/8 "2020-01-04T19:56:29Z")

</div>

No, I don't think I have explained this correctly. It is a Tools option.This works great:  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/d/d05570e803716848535206c0d4ea6592dd11589c.png)  
This doesn't: ![image](https://community.mp3tag.de/uploads/default/original/2X/a/a5ae0392636dcd6dfb422254024183456921fd6b.png)  
because I can't remove the 'THE ' from the search

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [January 4, 2020, 8:01pm UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/9 "2020-01-04T20:01:06Z")

</div>

Which property does contain the "The"?  
Is it the filename of the audio track?  
is it as you said here

> [@flyingmale](#):
>
> A://songBiogs/%artist%.txt".

%artist%?  
The regular expression ($regexp()) removes a leading "The" from the referenced string. Currently the string is taken from the field ARTIST.  
If this is not correct, then use the correct field.

---

<div class="post-metadata">

**Author:** ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)\
**Post date:** [January 4, 2020, 10:23pm UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/10 "2020-01-04T22:23:58Z")

</div>

> [@flyingmale](#):
>
> This doesn't

For the parameter, try this: `"A:\songBiogs\$regexp(%artist%,^The ,).txt"`  
Include the double quotes.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [January 4, 2020, 10:31pm UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/11 "2020-01-04T22:31:12Z")

</div>

I wonder why the first example works.  
It has double forward slashes and forward slashes.  
I also do not know if the letter "A" is a valid one for a drive as it was designated for floppy disc drives in the old days.

---

<div class="post-metadata">

**Author:** ![flyingmale](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flyingmale/32/8335_2.png) [@flyingmale](https://community.mp3tag.de/u/flyingmale)\
**Post date:** [January 5, 2020, 10:45am UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/12 "2020-01-05T10:45:30Z")

</div>

Drive 'A' works fine in everything else.  
Yes, 'THE ' is in the %artist% field, as in the example above and I had also used the double quotes initially.  
However, "A:\songBiogs$regexp(%artist%,^The ,).txt" returns this (suggesting it is still looking for THE BEAT'. not 'BEAT'..?):  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/2/2fe6297003b5352a2c53ac5760c772fe45b5c9a3.png)

---

<div class="post-metadata">

**Author:** ![flyingmale](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flyingmale/32/8335_2.png) [@flyingmale](https://community.mp3tag.de/u/flyingmale)\
**Post date:** [January 5, 2020, 10:49am UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/13 "2020-01-05T10:49:23Z")

</div>

PS: In 'Actions', this works fine to do the opposite, ie, save a FILENAME without the initial THE from the %artist% field...  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/5/51c606f3ee6ff0a4b4ec55ca69e047ac0f25731d.png)

---

<div class="post-metadata">

**Author:** ![flyingmale](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flyingmale/32/8335_2.png) [@flyingmale](https://community.mp3tag.de/u/flyingmale)\
**Post date:** [January 5, 2020, 11:09am UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/14 "2020-01-05T11:09:07Z")

</div>

Also, I've just thought that maybe I have given the impressions that this is in 'Actions', when it is actually an operation in 'Options \> Tools'

---

<div class="post-metadata">

**Author:** ![flyingmale](https://community.mp3tag.de/user_avatar/community.mp3tag.de/flyingmale/32/8335_2.png) [@flyingmale](https://community.mp3tag.de/u/flyingmale)\
**Post date:** [January 5, 2020, 11:20am UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/15 "2020-01-05T11:20:53Z")

</div>

Thanks for the help. I have found a solution, though not ideal because it needs two options because it strips the first four characters regardless. So there is one for %artist% that don't begin with 'THE '...  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/0/0db80a2a7bcdd6158d0075870de13d6fc388a6e5.png)  
and one for those which do..  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/6/6d74fc907990c44c57e6f4975b6cd6ab80406c3a.png)  
Ideally, I need a line which strips the first four characters of %artist%, but ONLY if those first four characters are 'THE ' !!!!

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [January 5, 2020, 12:22pm UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/16 "2020-01-05T12:22:38Z")

</div>

> [@flyingmale](#):
>
> However, "A:\songBiogs$regexp(%artist%,^The ,).txt" returns this (

The $regexp() function is case sensitive.  
If you OS does not care about the case, you could use:  
`$regexp($lower(%artist%),^the ,)`

---

<div class="post-metadata">

**Author:** ![ryerman](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ryerman/32/5285_2.png) [@ryerman](https://community.mp3tag.de/u/ryerman)\
**Post date:** [January 5, 2020, 3:50pm UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/17 "2020-01-05T15:50:21Z")

</div>

> [@ohrenkino](#):
>
> The $regexp() function is case sensitive.

Also, the $regexp() function can be made case insensitive by using the 4th parameter: 1  
Like this: `$regexp(%artist%,^ThE ,,1)`

> **[Scripting Functions – Mp3tag Documentation](https://docs.mp3tag.de/scripting/#string-functions)**
>
> Documentation on Mp3tag's scripting functions. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 9, 2026, 12:28pm UTC](https://community.mp3tag.de/t/stripping-the-from-import/47402/18 "2026-02-09T12:28:22Z")

</div>


