# Create filename using $replace

**URL:** https://community.mp3tag.de/t/create-filename-using-replace/49554
**Category:** Support
**Created:** [July 6, 2020, 9:07am UTC](https://community.mp3tag.de/t/create-filename-using-replace/49554 "2020-07-06T09:07:20Z")
**Posts on this page:** 1
**Showing post:** 4

<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: [July 6, 2020, 9:33am UTC](https://community.mp3tag.de/t/create-filename-using-replace/49554/4 "2020-07-06T09:33:52Z")

</div>

Are you also sure about the $cutleft()  
E.g. and album like "... and then there were three ..."  
would be come  
"d then there were three ..."  
plus the removal of the trailing dots:  
"d then there were three "

To compare strings: `$if($eql(string1,string2),true do this,false do this)`  
`$if($eql($right(%album%,3),...),...,)`

You had a correct syntax in this thread:

> [@Replace characters in filename playlist creation](https://community.mp3tag.de/t/replace-characters-in-filename-playlist-creation/15715):
>
> Hi I'm trying to write an action that trawls through all my mp3s in all folders and creates a playlist in each folder The code below works fine: $filename(%\_folderpath%\$if($eql(%albumartist%,Various Artists),$cutleft(%album%,6),%artist% - $cutleft(%album%,6)).m3u8,utf-8)#EXTM3U #EXTART:$if($eql(%albumartist%,Various Artists),%albumartist%,%artist%) #EXTALB:%album% $loop(%track%)$loop(%\_filename\_ext%)#EXTINF:%\_length\_seconds%,%artist% - %title% %\_filename\_ext% $loopend()$loopend() However - …

---

_[View the full topic](https://community.mp3tag.de/t/create-filename-using-replace/49554)._
