# How to extract part of Path to Comment field?

**URL:** https://community.mp3tag.de/t/how-to-extract-part-of-path-to-comment-field/43260
**Category:** Support
**Created:** [October 14, 2018, 1:00pm UTC](https://community.mp3tag.de/t/how-to-extract-part-of-path-to-comment-field/43260 "2018-10-14T13:00:02Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![tagger100](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/9de053/32.png) [@tagger100](https://community.mp3tag.de/u/tagger100)
#### Post date: [October 14, 2018, 1:00pm UTC](https://community.mp3tag.de/t/how-to-extract-part-of-path-to-comment-field/43260/1 "2018-10-14T13:00:02Z")

</div>

Trying to transfer data from Tag-Tag. Would like to extract part of Path to Comment field of Tag. Is this possible? Can't find a way. Thanks

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [October 14, 2018, 1:30pm UTC](https://community.mp3tag.de/t/how-to-extract-part-of-path-to-comment-field/43260/2 "2018-10-14T13:30:29Z")

</div>

It's the converter "Filename – Tag" in this case, see this post from the FAQ for details:

> [@Converters to rename files or to import tags](https://community.mp3tag.de/t/converters-to-rename-files-or-to-import-tags/8016/3):
>
> How to import parts of the filename into the tag? Importing tags from filenames and directory names can be done by using the [Converter \> Filename - Tag] Converter \> Filename - Tag. The basic concept is the notion of a format string which describes the structure of the name to import from. The format string is built of either standard text (e.g., Music), placeholders (such as %artist%, %title%, ...), or backslash characters \ that denote directory structures. Here is an example that imports t…

---

<div class="post-metadata">

### Author: ![tagger100](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/9de053/32.png) [@tagger100](https://community.mp3tag.de/u/tagger100)
#### Post date: [October 14, 2018, 5:41pm UTC](https://community.mp3tag.de/t/how-to-extract-part-of-path-to-comment-field/43260/3 "2018-10-14T17:41:51Z")

</div>

Having problem with this. Let's make a simpler case. Using File to Tag, Copy dir (folder) name to comment field if ID3. Assume dir name is: Abc-def. I can't even do that. Sorry. I can extract anything from filename to tag, but not from directory name.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [October 14, 2018, 6:25pm UTC](https://community.mp3tag.de/t/how-to-extract-part-of-path-to-comment-field/43260/4 "2018-10-14T18:25:45Z")

</div>

In the topic linked above, there is a section on _How to import parts of the folder structure into the tag?_ Have you seen this? It describes how to import from directory name.

Let me know if anything is unclear and if so, possibly give an example of what you've tried.

---

<div class="post-metadata">

### Author: ![tagger100](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/9de053/32.png) [@tagger100](https://community.mp3tag.de/u/tagger100)
#### Post date: [October 14, 2018, 7:50pm UTC](https://community.mp3tag.de/t/how-to-extract-part-of-path-to-comment-field/43260/5 "2018-10-14T19:50:44Z")

</div>

Yes, I did read it all. Tried the following \ %comment%  
Wanted the whole directory name copied to comment in ID3 tag

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [October 14, 2018, 8:12pm UTC](https://community.mp3tag.de/t/how-to-extract-part-of-path-to-comment-field/43260/7 "2018-10-14T20:12:38Z")

</div>

Everything from the directory path comes before the `\`, so it would be `%comment%\`. Since you don't want to import anything from the filename, you need to denote it with `%dummy%`.

So the correct format string would be  
`%comment%\%dummy%`

---

<div class="post-metadata">

### Author: ![tagger100](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/9de053/32.png) [@tagger100](https://community.mp3tag.de/u/tagger100)
#### Post date: [October 14, 2018, 11:02pm UTC](https://community.mp3tag.de/t/how-to-extract-part-of-path-to-comment-field/43260/9 "2018-10-14T23:02:26Z")

</div>

Thanks - made progress 🙂 This did work:

`%comment%\%dummy%`

Now will have to try filtering out part of that directory 🙂

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [October 15, 2018, 7:10am UTC](https://community.mp3tag.de/t/how-to-extract-part-of-path-to-comment-field/43260/11 "2018-10-15T07:10:55Z")

</div>

> [@tagger100](#):
>
> Now will have to try filtering out part of that directory

It follows the same pattern. If your directory name consists of, e.g., two parts where you want to omit one of them, use `%dummy%` again for the part you want to filter out.

An example directory name would be `abc def - xyz` and you only want to import the `xyz` part. A format string to achieve that would be

`%dummy% - %comment%\%dummy%`

---

<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:27pm UTC](https://community.mp3tag.de/t/how-to-extract-part-of-path-to-comment-field/43260/12 "2026-02-09T12:27:43Z")

</div>


