# Replace Backslash by Slash

**URL:** https://community.mp3tag.de/t/replace-backslash-by-slash/10795
**Category:** Support
**Created:** [September 11, 2010, 3:13pm UTC](https://community.mp3tag.de/t/replace-backslash-by-slash/10795 "2010-09-11T15:13:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Pebbelz](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@Pebbelz](https://community.mp3tag.de/u/Pebbelz)
#### Post date: [September 11, 2010, 3:13pm UTC](https://community.mp3tag.de/t/replace-backslash-by-slash/10795/1 "2010-09-11T15:13:06Z")

</div>

Hi Forum,

I'm fighting with scripting to create a Playlist with relative Pathnames and "Forward"-Slashes instead of Back"-Slashes.  
So far I created a small mte-File to make that happen, but ... unfortunately it does not what I want ![:angry:](https://community.mp3tag.de/uploads/default/original/1X/ebadaff04ae073d3d1cb3e2f4c6acf132380e5a5.gif ":angry:")  
Could somebody have a look on my Code and tell me whats wrong

> [@](#):
>
> $filename(%\_directory%.m3u)  
> $Replace(%\_folderpath\_rel%,'','/')  
> $loop(%\_path%)  
> %\_folderpath\_rel%%\_filename\_ext%$loopend()

The "Replace" in Line 2 should change the \ to / in the Variable %\_folderpath\_rel%. Probably I am using the wrong function 😲 Please advise

btw: I tried as well some relexp ... but that always ends up in a Syntax-Desaster - I got no glue on how to define a working relexp .. and how to use a relexp in conjunction with replace ... do I have to do that ?

Any recommendations are welcome ... Thankx  
Alex

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [September 11, 2010, 3:29pm UTC](https://community.mp3tag.de/t/replace-backslash-by-slash/10795/2 "2010-09-11T15:29:16Z")

</div>

> [@Pebbelz](#):
>
> ... I'm fighting with scripting to create a Playlist with relative Pathnames and "Forward"-Slashes instead of Back"-Slashes. ... Any recommendations are welcome ...

Try this export script ...

```
$filename(%_directory%.m3u)
$loop(%_path%)
$replace(%_folderpath_rel%%_filename_ext%,'\','/')$loopend()

```

DD.20100911.1929.CEST

---

<div class="post-metadata">

### Author: ![Pebbelz](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@Pebbelz](https://community.mp3tag.de/u/Pebbelz)
#### Post date: [September 11, 2010, 3:42pm UTC](https://community.mp3tag.de/t/replace-backslash-by-slash/10795/3 "2010-09-11T15:42:37Z")

</div>

QUOTE (DetlevD @ Sep 11 2010, 19:29) \<{POST\_SNAPBACK}\>

Try this export script ...

```
$filename(%_directory%.m3u)
$loop(%_path%)
$replace(%_folderpath_rel%%_filename_ext%,'\','/')$loopend()

```

DD.20100911.1929.CEST

Wow, great response ... and It works ! ![:w00t:](https://community.mp3tag.de/uploads/default/original/1X/cb01eca72fe9339ff6f3ec9f1e3c5fe002be0f0a.gif ":w00t:") ![:w00t:](https://community.mp3tag.de/uploads/default/original/1X/cb01eca72fe9339ff6f3ec9f1e3c5fe002be0f0a.gif ":w00t:") Thankx so much!

Now, just one question for my understanding - are these kind of mp3tag-variables like %\_folderpath\_rel% static and this was the reason why my Code wont run? I am asking so silly, because I could not see a major difference between your GOOD Code and my BAD Code ![:rolleyes:](https://community.mp3tag.de/uploads/default/original/1X/3a79e8b0b7d169b30216785521d7c6f4f895c421.gif ":rolleyes:")

Kind Regards  
Alex

---

<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:22pm UTC](https://community.mp3tag.de/t/replace-backslash-by-slash/10795/4 "2026-02-09T12:22:32Z")

</div>


