# Pulling location from directory into an action

**URL:** https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877
**Category:** Support
**Created:** [December 17, 2024, 2:17pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877 "2024-12-17T14:17:46Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![dp19](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/a8b319/32.png) [@dp19](https://community.mp3tag.de/u/dp19)
#### Post date: [December 17, 2024, 2:17pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877/1 "2024-12-17T14:17:46Z")

</div>

![Screenshot (3)](https://community.mp3tag.de/uploads/default/original/3X/b/a/ba84c552c95540df7ff859308c6549815499c704.png)  
ok i know i've been told how to do this but everything i have try isn't working. i like to have the country added into the tag but don't the correct action format to get this done. my action is

format value  
field \_directory  
string %dummy% - %Country% i know country is a field value. so what is the correct action to set this up please? i have this on and old pc but now trying setup on a new one, Thank You

---

<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: [December 17, 2024, 2:56pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877/2 "2024-12-17T14:56:15Z")

</div>

It is not clear to me what you want to do.  
If you want to add the country to the existing folder name, then there is an action example in the FAQs:

> [@Actions and batch-operations](https://community.mp3tag.de/t/actions-and-batch-operations/967/5):
>
> How to append the string " xyz" to the content of a tag field? Create a [new action](https://community.mp3tag.de/t/actions/967/2) in an existing action group and choose Format value as action type. Field specifies the tag field the formatting rule should be applied to. Format string must have the field placeholder for the field selected above and the string which should be appended. Example: If you want to append the string " xyz" to the current value of the comment field: Action type: Format value Field: COMMENT Format string: %com…

Please note that %dummy% does not work in actions of the type "Format value" or in a way it does but it always returns an empty string.

If you want to get the field COUNTRY filled with data from the folder name, then the type of action is not correct but you have to use "Guess value".

Also see here:

> [@Tag info from \_directory](https://community.mp3tag.de/t/tag-info-from-directory/66004):
>
> Hello once again i'm on the correct format string needed to pull tag info from a frirectory, i can't figure the string to pulll the following from a directory, adam ant -england - rock. my goal is to add the country and genre within the tag. can someone please help with the format string. Thank You i

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [December 17, 2024, 3:37pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877/3 "2024-12-17T15:37:09Z")

</div>

> [@dp19](#):
>
> i like to have the country added into the tag

And where should be the content with a country name in your example screenshot?  
I only see `E:\-\` for your Harry Styles song.

So from where exactly do you want to pull the COUNTRY from?  
You can only pull content that exists.

If your path or directory would contain something like  
`e:\USA\Harry Styles\01 - First track.mp3`  
you could pull **USA** as country from it. But in your example there is nothing like a country.

Please show us a real example screenshot from your collection.

---

<div class="post-metadata">

### Author: ![dp19](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/a8b319/32.png) [@dp19](https://community.mp3tag.de/u/dp19)
#### Post date: [December 17, 2024, 4:36pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877/4 "2024-12-17T16:36:42Z")

</div>

so sorry i left it out i like it to be inputed as tag filed Country USa or whatever inside the tag. like this  
artist a-ha  
country US  
genre Pop  
year 2024  
it this make any sense to you all.

---

<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: [December 17, 2024, 4:48pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877/5 "2024-12-17T16:48:50Z")

</div>

Try an action of the type "Format value" or Convert\>Tag-Tag for \_DIRECTORY  
Format string: %\_directory% - %country%

Perhaps an initial try-out with the Convert function is safer as that has a preview

---

<div class="post-metadata">

### Author: ![dp19](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/a8b319/32.png) [@dp19](https://community.mp3tag.de/u/dp19)
#### Post date: [December 17, 2024, 5:13pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877/6 "2024-12-17T17:13:11Z")

</div>

try guess value and that work but how can i set it so that when i do other artist it will show up under whatever artist i'm working on. right now i have it set to alison krauss,

---

<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: [December 17, 2024, 5:30pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877/7 "2024-12-17T17:30:37Z")

</div>

> [@dp19](#):
>
> try guess value

Why do you try "Guess value" when I just suggested "Format value"?  
Is is that you want to rename the folder or get data from the folder name?

---

<div class="post-metadata">

### Author: ![dp19](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/a8b319/32.png) [@dp19](https://community.mp3tag.de/u/dp19)
#### Post date: [December 17, 2024, 5:45pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877/8 "2024-12-17T17:45:54Z")

</div>

> [@ohrenkino](#):
>
> Try an action of the type "Format value" or Convert\>Tag-Tag for \_DIRECTORY  
> Format string: %\_directory% - %country%

i like to get data from the folder, i also tried both  
Try an action of the type "Format value" or Convert\>Tag-Tag for \_DIRECTORY  
Format string: %\_directory% - %country%  
and neither will work so i'm not sure what i'm doing wrong.

---

<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: [December 17, 2024, 5:50pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877/9 "2024-12-17T17:50:19Z")

</div>

Sorry, but your descriptions are very hard to understand.  
To get data from the folder name try an action of the type "Guess value"  
Source format: %\_directory%  
Guessing pattern: .....?  
I don't know the guessing pattern as you have not shown an example for the folder name anywhere.

---

<div class="post-metadata">

### Author: ![dp19](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/a8b319/32.png) [@dp19](https://community.mp3tag.de/u/dp19)
#### Post date: [December 17, 2024, 6:12pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877/10 "2024-12-17T18:12:21Z")

</div>

![Screenshot (4)](https://community.mp3tag.de/uploads/default/original/3X/b/7/b769cffbb9e65aaf61f9aa66b372e06532dd64c0.png)

folder name E:\james taylor - us

---

<div class="post-metadata">

### Author: ![dp19](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/a8b319/32.png) [@dp19](https://community.mp3tag.de/u/dp19)
#### Post date: [December 17, 2024, 6:19pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877/11 "2024-12-17T18:19:51Z")

</div>

I Got IT

guess value  
surce %\_directory%  
string %dummy% %country%  
Thanks for the help

---

<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: [December 17, 2024, 6:26pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877/12 "2024-12-17T18:26:07Z")

</div>

> [@dp19](#):
>
> string %dummy% %country%

If you want to get also hits for 2-word-countries try  
Guessing pattern %dummy% - %country%

Your pattern may work for countries with just a single word. The guessing pattern uses the space character as separator and therefore "United Kingdom" would be taken as "Kingdom".  
The hyphen is a better separator as it is apparently is unique in the folder name.

---

<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: [January 16, 2025, 6:27pm UTC](https://community.mp3tag.de/t/pulling-location-from-directory-into-an-action/66877/13 "2025-01-16T18:27:04Z")

</div>

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