# maintain playlist after file rename/move

**URL:** https://community.mp3tag.de/t/maintain-playlist-after-file-rename-move/6247
**Category:** General Discussion
**Created:** [February 13, 2008, 10:16pm UTC](https://community.mp3tag.de/t/maintain-playlist-after-file-rename-move/6247 "2008-02-13T22:16:51Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bucky](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/5f8ce5/32.png) [@bucky](https://community.mp3tag.de/u/bucky)
#### Post date: [February 13, 2008, 10:16pm UTC](https://community.mp3tag.de/t/maintain-playlist-after-file-rename-move/6247/1 "2008-02-13T22:16:51Z")

</div>

Here's a common situation for me: I often rename an mp3 file or re-arrange the folder structure, which breaks my playlists, since the playlist would be referencing an invalid file.

For example, I have a file called "U2 - One.mp3" in multiple playlists. I decide to rename it to "U2 - Achtung Baby - One.mp3" which breaks all the playlists that it belongs to.

What are good ways to handle this scenario? Here is my solution, but I welcome any other suggestions. I would create custom ID3 tags for each playlist, like PLAYLIST\_A = true. PLAYLIST\_B = true. PLAYLIST\_C = true. That way, when I change file name, I can simply filter using my custom ID3 tag, then quickly recreate the playlist without losing the file.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [February 18, 2008, 5:05pm UTC](https://community.mp3tag.de/t/maintain-playlist-after-file-rename-move/6247/2 "2008-02-18T17:05:45Z")

</div>

> Here's a common situation for me

Me too!

> Here is my solution, but I welcome any other suggestions. I  
> would create custom ID3 tags for each playlist, like PLAYLIST\_A = true.

That will lose order - try e.g. PLAYLIST\_A=1

> I can simply filter using my custom ID3 tag, then quickly recreate the playlist

That will lose repeats - try... dunno! 😉

For a big forthcoming rename, I'll try

1. Copy the original paths to a custom field.
2. Rename
3. Export a batch file of command-line edits, to be applied to every .m3u

[EDIT:] Update: this worked fine, with Step 3 using Cygwin sed taking only about 3 mins for 6200 tracks and 80 playlists. Warning for WMP9 users: valid references can have pathname case mismatches! So be sure to match with case-insensitivity e.g. use the sed 'I' pattern option.
