# Syntax error on removal of certain characters and text

**URL:** <https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864>\
**Category:** Support\
**Created:** [August 9, 2020, 12:08pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864 "2020-08-09T12:08:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 9, 2020, 12:08pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/1 "2020-08-09T12:08:37Z")

</div>

Hello there, I'm trying to remove certain words and characters from MP3 files but I seem to have typed something wrong?

Can someone please tell me what the problem is?

 ![](https://community.mp3tag.de/uploads/default/original/2X/0/02c08042bdb93bdd68745e433317fbaa64c2153d.png)

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:** [August 9, 2020, 12:14pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/2 "2020-08-09T12:14:00Z")

</div>

Could you copy and paste your expression here to the forum in plain text? I am not too eager to type in all myself.  
To show code as it is without the forum formatter hitting, enclose the code in the grave accent.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 9, 2020, 12:22pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/3 "2020-08-09T12:22:49Z")

</div>

Of course, thanks.

[#0]  
T=5  
! Remove Text (Album, Digital Album, EP, LP and Single) DIRECTORY=  
F=\_DIRECTORY  
1=$replace(%\_directory%, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

[#1]  
T=5  
! Remove Text (Acoustic, Album, Digital Album, EP, LP and Single) from FILENAME=  
F=\_FILENAME  
1=$replace(%\_filename%, '(acoustic')',, ''album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

[#2]  
T=5  
! Remove Text (Album, Digital Album, EP, LP and Single) from ALBUM=  
F=\_ALBUM  
1=$replace(%\_album%, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

[#3]  
T=5  
! Remove Text (Acoustic, Album, Digital Album, EP, LP and Single) from TITLE=  
f=TITLE  
1=$replace(%title%, '(acoustic')',, ''album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

---

<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:** [August 9, 2020, 12:31pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/4 "2020-08-09T12:31:13Z")

</div>

You can test your strings in Convert\>Tag-Tag.  
I don't get an error in the string for \_directory.  
I get one for \_filename probably as

> [@sheepdisease](#):
>
> '(acoustic')'

should be `'('acoustic')'`  
ALBUM seems to be OK  
TITLE has the same string as \_filename and is not OK.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 9, 2020, 12:53pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/5 "2020-08-09T12:53:52Z")

</div>

> [@sheepdisease](#):
>
> [#0]  
> T=5  
> ! Remove Text (Album, Digital Album, EP, LP and Single) DIRECTORY=  
> F=\_DIRECTORY  
> 1=$replace(%\_directory%, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)
> 
> [#1]  
> T=5  
> ! Remove Text (Acoustic, Album, Digital Album, EP, LP and Single) from FILENAME=  
> F=\_FILENAME  
> 1=$replace(%\_filename%, '(acoustic')',, ''album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)
> 
> [#2]  
> T=5  
> ! Remove Text (Album, Digital Album, EP, LP and Single) from ALBUM=  
> F=\_ALBUM  
> 1=$replace(%\_album%, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)
> 
> [#3]  
> T=5  
> ! Remove Text (Acoustic, Album, Digital Album, EP, LP and Single) from TITLE=  
> f=TITLE  
> 1=$replace(%title%, '(acoustic')',, ''album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

Thanks, a few errors!

[#0]  
T=5  
! Remove Text (Album, Digital Album, EP, LP and Single) DIRECTORY=  
F=\_DIRECTORY  
1=$replace(%\_directory%, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

[#1]  
T=5  
! Remove Text (Acoustic, Album, Digital Album, EP, LP and Single) from FILENAME=  
F=\_FILENAME  
1=$replace(%\_filename%, '('acoustic')',, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

[#2]  
T=5  
! Remove Text (Album, Digital Album, EP, LP and Single) from ALBUM=  
F=\_ALBUM  
1=$replace(%\_album%, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

[#3]  
T=5  
! Remove Text (Acoustic, Album, Digital Album, EP, LP and Single) from TITLE=  
f=TITLE  
1=$replace(%title%, '('acoustic')',, '('album')',, '('digital album')',, '('ep')',, '('lp')',, '('single')',)

Is there something wrong with this? It doesn't seem to do anything.

---

<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:** [August 9, 2020, 12:57pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/6 "2020-08-09T12:57:06Z")

</div>

> [@sheepdisease](#):
>
> It doesn't seem to do anything.

I don't know what the original data looks like ... so I cannot tell if there would be any hits.  
Perhaps it is somewhere along this line: $replace() is case sensitive.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 9, 2020, 1:06pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/7 "2020-08-09T13:06:35Z")

</div>

Okay, I think the problem could be bigger than this.

I'm getting an error when I try closing MP3tag now. I don't even have a y drive?

## ================================================================================ Mp3tag v3.02 - 09.08.2020 - 14:01:21

## OS-Version: Windows 10, 64-bit

## Build: Jul 11 2020 11:14:04

# AppPath: 114.270.347.264 Bytes frei (C:\Program Files (x86)\Mp3tag) DataPath: 114.270.347.264 Bytes frei (C:\Users\user\AppData\Roaming\Mp3tag\data) TempPath: 114.270.347.264 Bytes frei (C:\Users\user\AppData\Local\Temp\Mp3tag v3.02)

## ================================================================================ ERROR

File: y:\projects\_main\szipfile.cpp  
Line: 302  
Expression: \_S\_TRUE(bRetVal)  
LastError: 0x00000000 The operation completed successfully.

* * *

## THROW

## File: y:\projects\_main\szipfile.cpp Line: 377

## THROW

## File: y:\projects\mp3tag\mtconfigurationexporter.cpp Line: 79

## CATCH

# File: y:\projects\mp3tag\mtdocument.cpp Line: 132

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 9, 2020, 1:07pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/8 "2020-08-09T13:07:31Z")

</div>

@Florian Could you please tell me what this is?

---

<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:** [August 9, 2020, 1:10pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/9 "2020-08-09T13:10:16Z")

</div>

It could be that, as you are manipulating the filename and the folder name in an action group that you cause access violations.

Try to separate the actions that treat the file attributes from those that edit the tag fields.

Quite honestly: why don't you prepare the tag fields and then generate filenames and folder names from the modified tag fields?

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 9, 2020, 1:44pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/10 "2020-08-09T13:44:46Z")

</div>

I like the option to run a script as/when instances come up.

I just checked and every time I close mp3tag now, without running any actions, I'm getting the error.

@Florian

---

<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:** [August 9, 2020, 1:48pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/11 "2020-08-09T13:48:38Z")

</div>

It could be that the file mp3tag.cfg and others are still blocked by the OS due to the previous crash.  
See if a new start remedies the problem.  
If not, I would assume that something corrupted MP3tag files. Perhaps a new installation then helps.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 9, 2020, 1:53pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/12 "2020-08-09T13:53:28Z")

</div>

Oh damn, even a reinstall of the program isn't fixing it. I'll try restarting the laptop.

---

<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:** [August 9, 2020, 1:57pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/13 "2020-08-09T13:57:10Z")

</div>

and then there is always the possibility that a file is up the spout and needs fixing.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 9, 2020, 1:58pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/14 "2020-08-09T13:58:32Z")

</div>

Restart didn't work, do you understand the error log?

---

<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:** [August 9, 2020, 2:01pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/15 "2020-08-09T14:01:33Z")

</div>

It looks to me like the configuration file could not be written, i.e. is corrupt. So if you rename the mp3tag.cfg file and the file Mp3tagsettings.zip while MP3tag is not running and then start MP3tag successfully, it was those files.  
You loose the customization, though.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 9, 2020, 2:07pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/16 "2020-08-09T14:07:45Z")

</div>

Thanks for your suggestion. I renamed the files and loaded up mp3tag. When I tried to close again, it came up with an error.

## ================================================================================ Mp3tag v3.02 - 09.08.2020 - 15:06:05

## OS-Version: Windows 10, 64-bit

## Build: Jul 11 2020 11:14:04

# AppPath: 120.577.970.176 Bytes frei (C:\Program Files (x86)\Mp3tag) DataPath: 120.577.970.176 Bytes frei (C:\Users\user\AppData\Roaming\Mp3tag\data) TempPath: 120.577.970.176 Bytes frei (C:\Users\user\AppData\Local\Temp\Mp3tag v3.02)

## ================================================================================ ERROR

File: y:\projects\_main\szipfile.cpp  
Line: 302  
Expression: \_S\_TRUE(bRetVal)  
LastError: 0x00000000 The operation completed successfully.

* * *

## THROW

## File: y:\projects\_main\szipfile.cpp Line: 377

## THROW

## File: y:\projects\mp3tag\mtconfigurationexporter.cpp Line: 79

## CATCH

# File: y:\projects\mp3tag\mtdocument.cpp Line: 132

---

<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:** [August 9, 2020, 2:31pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/17 "2020-08-09T14:31:43Z")

</div>

I am now past my ideas - you need a clean installation, don't know what happened in the meantime.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 9, 2020, 2:46pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/18 "2020-08-09T14:46:03Z")

</div>

I am still getting errors after reinstalling.

---

<div class="post-metadata">

**Author:** ![Jimmy\_Neutron](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/j/9de053/32.png) [@Jimmy\_Neutron](https://community.mp3tag.de/u/Jimmy_Neutron)\
**Post date:** [August 9, 2020, 4:05pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/19 "2020-08-09T16:05:23Z")

</div>

My advice would be to get out of the Program Files (x86) folder. Windows believes it owns that folder along with any programs "installed" there and it appears that your config info is held in AppData\Roaming (etc).

You should test by downloading and extracting the Mp3tag zip file into a subfolder of your downloads directory. Go into that subfolder and start by double-clicking on Mp3tag.exe

This will ensure that you will be starting with a "clean" instance of Mp3tag.

Please see if you continue to get errors.

---

<div class="post-metadata">

**Author:** ![sheepdisease](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/d07c76/32.png) [@sheepdisease](https://community.mp3tag.de/u/sheepdisease)\
**Post date:** [August 9, 2020, 5:48pm UTC](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864/20 "2020-08-09T17:48:26Z")

</div>

Thanks for your reply.

I did a new install in A:\Downloads\Mp3tag and ran it from that directory and I'm still getting errors.

[Next page](https://community.mp3tag.de/t/syntax-error-on-removal-of-certain-characters-and-text/49864.md?page=2)
