# Import data from text file to user-defined field

**URL:** https://community.mp3tag.de/t/import-data-from-text-file-to-user-defined-field/57109
**Category:** Mac
**Created:** [April 23, 2022, 10:09am UTC](https://community.mp3tag.de/t/import-data-from-text-file-to-user-defined-field/57109 "2022-04-23T10:09:22Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nylamb](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/ecd19e/32.png) [@nylamb](https://community.mp3tag.de/u/nylamb)
#### Post date: [April 23, 2022, 10:09am UTC](https://community.mp3tag.de/t/import-data-from-text-file-to-user-defined-field/57109/1 "2022-04-23T10:09:22Z")

</div>

I do not know if this would be a "separate" issue as "the reading of a nfo file into a user defined field" works in windows .. but after I figured out the basics on how to grab the data i need, when I went to try this on a mac .. it was not possible to read the nfo file into a user defined field.

Is there a way I can this this same method in a similar manner in the mac version of the software? (or is it not possible as based from this question submitted at:  
[Import from text file](https://community.mp3tag.de/t/import-from-text-file/55186) ?)

---

<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: [April 23, 2022, 11:08am UTC](https://community.mp3tag.de/t/import-data-from-text-file-to-user-defined-field/57109/2 "2022-04-23T11:08:39Z")

</div>

Have a look at the Mac documentation and a way to import data from text files:

> [@Rename Files and Import Tags from Files](https://community.mp3tag.de/t/rename-files-and-import-tags-from-files/51720):
>
> Mp3tag provides a variety of possibilities to get tag information from parts of the filename or to rename files based on the information stored in the tag of a file. The base concept behind all converters in Mp3tag is the format string, which describes a pattern or template of a filename. A format string consists of any characters and predefined placeholders or scripting functions. Every placeholder begins with the percent sign %, followed by a tag field name and ends with the percent sign. …

---

<div class="post-metadata">

### Author: ![nylamb](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/n/ecd19e/32.png) [@nylamb](https://community.mp3tag.de/u/nylamb)
#### Post date: [April 23, 2022, 12:35pm UTC](https://community.mp3tag.de/t/import-data-from-text-file-to-user-defined-field/57109/3 "2022-04-23T12:35:58Z")

</div>

Hello and thank you for the reply ..

Excuse me if I get the jargon wrong ..

I've read that page as it was also listed on the issue from ticket(?) 55186 .. that I linked earlier in my question.

Unfortunately, the .nfo files are written from a movie scraper (media companion to be exact) and I am (attempting/trying to) moving the metadata from the external .nfo files to the metadata tags within the movie container(?) .. a mixture of mp4's (in .265) and mkv's (in .264). I do not know how to get the .nfo file into the structure of the text file as described in the "import tags from text files" section of that page.

I don't know coding but I was able to use the method described in the original ticket 50933 in order to read the data into the fields in the following manner ..

```auto
[#0]
T=14
F=PLEX_INFO
1=%_filename%.nfo

[#1]
T=5
1=$regexp(%plex_info%,'.*<title>(.*)</title>.*',$1)
F=TITLE

[#2]
T=5
1=$regexp(%plex_info%,'.*<originaltitle>(.*)</originaltitle>.*',$1)
F=ORIGINALTITLE

[#3]
T=5
1=$regexp(%plex_info%,'.*<set>(.*)</set>.*',$1)
F=SET

[#4]
T=5
1=$regexp(%plex_info%,'.*<setid>(.*)</setid>.*',$1)
F=SETID

[#5]
T=5
1=$regexp(%plex_info%,'.*<outline>(.*)</outline>.*',$1)
F=OUTLINE

```

... etc.

aside from a few "bumps" (with the multiple genres and actors) .. it was working quite well in the testing/learning I was doing on the windows version of the MP3tag software.

it is when I downloaded and ran the mac trial version .. I found it was different. (I am in the process of "attempting" to use a mac more consistently which is why I am seeking the possibility to do on macOS as I was able on Windows .. somehow.)

I would prefer if I can do it all from a mac .. but .. worst case scenario is that I will need to perform the metadata writes in windows .. and can hopefully find a way to workout the multiple genres and actors "issue" that I had posted (on the ticket this was split from).

Thanks again.
