# Scripting Issue to remove square characters

**URL:** <https://community.mp3tag.de/t/scripting-issue-to-remove-square-characters/60514>\
**Category:** Support\
**Created:** [March 27, 2023, 1:27pm UTC](https://community.mp3tag.de/t/scripting-issue-to-remove-square-characters/60514 "2023-03-27T13:27:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ve3auo](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ve3auo/32/13622_2.png) [@ve3auo](https://community.mp3tag.de/u/ve3auo)\
**Post date:** [March 27, 2023, 1:27pm UTC](https://community.mp3tag.de/t/scripting-issue-to-remove-square-characters/60514/1 "2023-03-27T13:27:27Z")

</div>

Hello All,

I think I have found an "undocumented feature" as I always called them when I was very active developing.

I have discovered that many of my files have strange characters in the title field. How they got there is unknown. I am using MP3Tag to try and remove them although I am running into a few issues/blockages with the available scripting options.

The "offending characters" are in the title field. They are at the leftmost position and are only displayed as a small, skinny, vertical, rectangle (see screen caps).

I have tried regex, scripting and whatever else I thought might work from MP3Tag.

In the screen caps, I tried `$right(%title%,$len(%title%)-1)` as well as `$right(%title%,$len(%title%)-10)`. As you can see in the captures, they both did the same thing. Nothing.  
 ![20230327 - Tagging Error - 1](https://community.mp3tag.de/uploads/default/original/2X/3/306a72432647cd5fed5feeb9972e9a7c6bdfdff1.png)  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/6/641877fd5c6d99a083370872f6144da382e3542f.png)

I even tried "filtering" to set the list to display only files with those "unknown" characters using regex and even regex could not reference those chars. It's like they are there but they aren't.

So far, I can only remove them manually and there are a substantial amount. I'd love to be able to automate it.

Clayton

---

<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:** [March 27, 2023, 1:39pm UTC](https://community.mp3tag.de/t/scripting-issue-to-remove-square-characters/60514/2 "2023-03-27T13:39:22Z")

</div>

You could check one of the titles in the extended tags dialogue Alt+T with the edit function and see what these characters are.

Another could be to copy them, paste them as search string into an action of the type "Replace" and replace them with nothing.

And if all that does not help - perhaps you could supply one of these files so that the community could have a closer look.

---

<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:** [March 27, 2023, 1:55pm UTC](https://community.mp3tag.de/t/scripting-issue-to-remove-square-characters/60514/3 "2023-03-27T13:55:54Z")

</div>

> [@ve3auo](#):
>
> $right(%title%,$len(%title%)-10)

This is not the correct syntax.  
If you want to subtract a value, you have to use the function $sub(), e.g.  
`$right(%title%,$sub($len(%title%),10))`

---

<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:** [March 27, 2023, 2:03pm UTC](https://community.mp3tag.de/t/scripting-issue-to-remove-square-characters/60514/4 "2023-03-27T14:03:48Z")

</div>

> [@ve3auo](#):
>
> I even tried "filtering"

To filter for control characters like 27 or 7 you could use this filter:  
`"$if($less($ord(%title%),32),1,0)" IS 1`

---

<div class="post-metadata">

**Author:** ![ve3auo](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ve3auo/32/13622_2.png) [@ve3auo](https://community.mp3tag.de/u/ve3auo)\
**Post date:** [March 27, 2023, 2:31pm UTC](https://community.mp3tag.de/t/scripting-issue-to-remove-square-characters/60514/5 "2023-03-27T14:31:52Z")

</div>

> [@ohrenkino](#):
>
> $right(%title%,$sub($len(%title%),10))

This worked to remove the unknown character. Thank you

---

<div class="post-metadata">

**Author:** ![ve3auo](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ve3auo/32/13622_2.png) [@ve3auo](https://community.mp3tag.de/u/ve3auo)\
**Post date:** [March 27, 2023, 2:34pm UTC](https://community.mp3tag.de/t/scripting-issue-to-remove-square-characters/60514/6 "2023-03-27T14:34:09Z")

</div>

> "$if($less($ord(%title%),32),1,0)" IS 1

This, I'm guessing, would work IF I knew what the code was for the character.

---

<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:** [March 27, 2023, 2:35pm UTC](https://community.mp3tag.de/t/scripting-issue-to-remove-square-characters/60514/7 "2023-03-27T14:35:43Z")

</div>

No, it would filter for all files where the first letter of TITLE has a code lower than 32 which represents the space character.  
It would be so much easier, if you simply tried it.

---

<div class="post-metadata">

**Author:** ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)\
**Post date:** [March 27, 2023, 2:36pm UTC](https://community.mp3tag.de/t/scripting-issue-to-remove-square-characters/60514/8 "2023-03-27T14:36:01Z")

</div>

There was some suggestions mage here about how to see what unicode characters may be hidden in text.

> [@Problem with Guess Values](https://community.mp3tag.de/t/problem-with-guess-values/60299/8):
>
> You can do that easily online, just copy & paste a string into tools like [https://www.babelstone.co.uk/Unicode/whatisit.html](https://www.babelstone.co.uk/Unicode/whatisit.html) or

---

<div class="post-metadata">

**Author:** ![ve3auo](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ve3auo/32/13622_2.png) [@ve3auo](https://community.mp3tag.de/u/ve3auo)\
**Post date:** [April 7, 2023, 5:09pm UTC](https://community.mp3tag.de/t/scripting-issue-to-remove-square-characters/60514/9 "2023-04-07T17:09:25Z")

</div>

Just an update,

I found the source of these strange characters.

I am using a combination of Picad and MP3Tag to clean up a very large library for a terrestrial and online radio station. They use Station Playlist. Once I finish the tagging, updating and corrections of the files, I run them through the "Track Tool" of SPL. It creates the ReplayGain and the CUE, Seque, etc. points. I also edit the SPL specific fields as needed for classification. It seems when this is done, the strange characters are introduced into various fields.

Time to contact the author of that software and advise him of this happening.

Thanks everyone

---

<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:** [May 7, 2023, 5:09pm UTC](https://community.mp3tag.de/t/scripting-issue-to-remove-square-characters/60514/10 "2023-05-07T17:09:28Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
