# How to import a file lyrics.txt

**URL:** https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306
**Category:** General Discussion
**Created:** [November 8, 2014, 11:44am UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306 "2014-11-08T11:44:15Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)
#### Post date: [November 8, 2014, 11:44am UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/1 "2014-11-08T11:44:15Z")

</div>

How to import a file lyrics with this expression %\_filename% (Lyrics).txt in the compartment of tag %unsyncedlyrics% if the file supports(bears) them (MP3) or in the compartment of tag %lyrics% if the file supports(bears) them. (FLAC)

---

<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: [November 8, 2014, 1:51pm UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/2 "2014-11-08T13:51:51Z")

</div>

You have to make sure that the lyrics are in one line as the "end-of-line" character is also the indication for "end-of-record".  
So the next line of lyrics would be treated as the lyrics for the next file.

So: prepare your text file by replacing each "end-of-line" character with a character that is hardly ever used in normal language e.g. # or \_.  
E.g.  
It's been a hard day's night  
And I've been working like a dog

becomes  
It's been a hard day's night\_And I've been working like a dog

When importing the lyrics into the tag, enter %lyrics% as target field.  
Actually, there are web sources plus tools that do some of the tricks for you. Check out  
[/t/2034/1](https://community.mp3tag.de/t/2034/1)

---

<div class="post-metadata">

### Author: ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)
#### Post date: [November 8, 2014, 3:39pm UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/3 "2014-11-08T15:39:36Z")

</div>

Thank you for your answer.

Here is that I would like to have. I would like to import a file txt as follows % ( Lyrics)

I made then

action type : import text file  
Field : UNSYNCEDLYRICS  
Filename : %\_filename% (Lyrics).txt

But I would like to make him(it) that if the tag of the file is ID3v2.3 (ID3v1 ID3v2.3) which would give the following code

Filename : $if($eql(%\_tag\_read%[(%\_tag%)],ID3v2.3 (ID3v1 ID3v2.3)),%\_filename% (Lyrics).txt)

Can you help me has the correct version?

---

<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: [November 9, 2014, 8:21am UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/4 "2014-11-09T08:21:38Z")

</div>

If it is only the filename: I would shorten that to:  
Filename : $if($eql(%\_tag\_read%,'ID3v2.3'),'%\_filename% (Lyrics).txt')

But as the function needs always a filename, you will get an error if the tag does not equal ID3v2.3.

In a way I thought that the problem was:  
either use %lyrics% for FLAC  
or use %unsyncedlyrics% for MP3  
when importing.

You can set a field mapping in File\>Options\>Tags\>Mapping  
Enter as Source: LYRICS and as Target: UNSYNCEDLYRICS.  
This should put the lyrics in the right field.

---

<div class="post-metadata">

### Author: ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)
#### Post date: [November 9, 2014, 9:38am UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/5 "2014-11-09T09:38:37Z")

</div>

Excuse me, but I did not understand.

---

<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: [November 9, 2014, 10:16am UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/6 "2014-11-09T10:16:37Z")

</div>

In a way we are stuck now, right?  
So: do you have problems with the filename or with the target field in flac files and the target field in mp3-files?

---

<div class="post-metadata">

### Author: ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)
#### Post date: [November 9, 2014, 11:55am UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/7 "2014-11-09T11:55:58Z")

</div>

I would like to make this:

Action type : import text file  
Field : UNSYNCEDLYRICS  
Filename : $if($eql(%\_tag\_read%[(%\_tag%)],ID3v2.3 (ID3v1 ID3v2.3)),%\_filename% (Lyrics).txt)

But I have a problem with the code. I do not manage to take the file. Thank you for your help(assistant).

---

<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: [November 9, 2014, 1:19pm UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/8 "2014-11-09T13:19:59Z")

</div>

> [@Sylvain.dmde](#):
>
> I would like to make this:
> 
> Action type : import text file  
> Field : UNSYNCEDLYRICS  
> Filename : $if($eql(%\_tag\_read%[(%\_tag%)],ID3v2.3 (ID3v1 ID3v2.3)),%\_filename% (Lyrics).txt)
> 
> But I have a problem with the code. I do not manage to take the file. Thank you for your help(assistant).

Die you have a try with the expression I offered in post #4:  
Filename : $if($eql(%\_tag\_read%,'ID3v2.3'),'%\_filename% (Lyrics).txt')

BUT: the $if() statement expects instructions for the positive and for the negative case. But you only offer a filename for the positive case.  
What is the filename supposed to be if the tag is not V2.3?

And: Wouldn't everything be much easier with a filter?

---

<div class="post-metadata">

### Author: ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)
#### Post date: [November 9, 2014, 8:21pm UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/9 "2014-11-09T20:21:24Z")

</div>

I would like that my words import automatically according to the type(chap) of tag of my musical files.

For files **.flac** I use the tag: **LYRICS**  
For files **.mp3** jutilise the tag: **UNSYNCEDLYRICS**

For files **.flac** I use the type(chap) of tag: **FLAC (FLAC)**  
For files **.mp3** I use the type(chap) of tag: **ID3v2.3 (ID3v1 ID3v2.3)**

I do not know which are the other uses for the other types(chaps) of musical file. For example for files **.ape** I do not know if he(it) uses **LYRICS** or **UNSYNCEDLYRICS** either the type(chap) of tag **FLAC (FLAC)** or **ID3v2.3 (ID3v1 ID3v2.3)**.

My files of words establish(constitute) in the following way: **%\_ filename% (Lyrics).txt**

I was going to import my words automatically according to the type(chap) of file dealt(handled,treated), the used tag and the type(chap) of tag.

For example:  
Type(Chap) of file: **.flac**  
Tag: **LYRICS**  
Type(Chap) of tag: **FLAC (FLAC)**

After that, I would need a fonction/une line of code which could detect me automatic the type(chap) of file used (example: **.flac** ) or the type(chap) of tag (example: **FLAC (FLAC)**) and which he can import me my words directly in the tag which suits (example: **LYRICS** )

I was going to make him(it) with:

Action type: import text file

If you have of ideas of import, I am interested.

---

<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: [November 10, 2014, 5:08am UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/10 "2014-11-10T05:08:40Z")

</div>

So the filename is always the same, only the target field is different.

Please have a look at the help on how to create user-defined mappings of fields - although I think that this is not necessary (I cannot test this as I do not use flac).

[https://docs.mp3tag.de/customization/options/tags/mapping](https://docs.mp3tag.de/customization/options/tags/mapping)

The mapping should take care of the right field name. Then there is no need to do this while importing.  
Anyway, I think that it is not possible to redefine the target field with a condition.

---

<div class="post-metadata">

### Author: ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)
#### Post date: [November 10, 2014, 5:00pm UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/11 "2014-11-10T17:00:51Z")

</div>

I would like to make that:

**action type : import texte file  
Field : LYRICS  
Filename : $if($eql(%\_tag%, FLAC (FLAC)),%\_filename% (Lyrics).txt**

That is if my tag is **FLAC (FLAC)** then to import the file named(appointed) as **%\_filename% (Lyrics).txt**

I make similar for my files .mp3

**Action type : import texte file  
Field : UNSYNCEDLYRICS  
Filename : $if($eql(%\_tag%, ID3v2.3 (ID3v1 ID3v2.3)),%\_filename% (Lyrics).txt**  
   
That is if my tag is **ID3v2.3 (ID3v1 ID3v2.3)** then to import the file named(appointed) as **%\_filename% (Lyrics).txt**

I make his(her,its) actions(shares) has the continuation(suite).

Like that I can select all my files without taking into account if they are .flac,.mp3 or other. And bam, my lyrics files are imported where it is necessary according to if they are .flac or others without worrying me about it.

Only my code of departure is not the voucher, which is this one: **$if($eql(%\_tag%, ID3v2.3 (ID3v1 ID3v2.3)),%\_filename% (Lyrics).txt**

Can you find me a good code?

---

<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: [November 10, 2014, 5:44pm UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/12 "2014-11-10T17:44:19Z")

</div>

> [@Sylvain.dmde](#):
>
> ... That is if my tag is **FLAC (FLAC)** then to import the file named(appointed) as **%\_filename% (Lyrics).txt**  
> ...  
> That is if my tag is **ID3v2.3 (ID3v1 ID3v2.3)** then to import the file named(appointed) as **%\_filename% (Lyrics).txt**  
> ...

Maybe you want something like this?

**LYRICS \<== $if($eql(%\_tag\_read%,'FLAC'),%\_filename%' (Lyrics).txt',%LYRICS%) UNSYNCEDLYRICS \<== $if($eql(%\_tag\_read%,'ID3v2.3'),%\_filename%' (Lyrics).txt',%UNSYNCEDLYRICS%)**

DD.20141110.1944.CET

Well, I think, the code proposal from above does not help, because it is crap !?!?  
DD.20141111.1836.CET

I checked it again.

Mp3tag shows the tag-field UNSYNCEDLYRICS, ...  
when it writes the tag-field USLT to ID3v2.x tag.

Mp3tag shows the tag-field UNSYNCEDLYRICS, ...  
when it writes the tag-field UNSYNCEDLYRICS to FLAC/Vorbis Comment tag.

Mp3tag shows the tag-field UNSYNCEDLYRICS, ...  
when it writes the tag-field LYRICS to FLAC/Vorbis Comment tag, ...  
because of the internal mapping of field names, ...  
see dialog "Mp3tag/Extras/Options/Tags/Mapping".

The FLAC tag get the internal Vorbis Comment tag-field LYRICS, ...  
regardless of working in the user interface with the tag-field UNSNCEDLYRICS or LYRICS.

Therefore it is not necessary, to create different commands or formatstrings for storing unsynced lyrics for the different tag-types ID3v2.x and FLAC.  
While working with the user interface of Mp3tag, both cases are treated in the same way, ...  
while under the hood Mp3tag directs the lyrics data to their designated technical tag-fields.

DD.20150308.1915.CET

---

<div class="post-metadata">

### Author: ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)
#### Post date: [November 10, 2014, 9:30pm UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/13 "2014-11-10T21:30:45Z")

</div>

It is exactly that! Thank you for your patience and for your answer.

---

<div class="post-metadata">

### Author: ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)
#### Post date: [March 7, 2015, 4:38pm UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/14 "2015-03-07T16:38:22Z")

</div>

Why is no longer good?

---

<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: [March 7, 2015, 5:18pm UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/15 "2015-03-07T17:18:06Z")

</div>

Because your approach does not work.  
You apply an action for a fixed field - either LYRICS or UNSYNCEDLYRICS.  
These fields should be mapped anyway. If you want to be sure, you have to create 2 different actions and make sure, you use the correct one.  
The filename you want to supply is the same everytime. It does not vary, regardless of audo file format, so there is no point to check it with a $IF-function.  
The interesting bit would be: what has happened when you tried your code with files? You surely must have some test files. What have you tried?  
Have you modified the mapping?  
Have you tried a filter?  
Have you tried your original code?  
Have you checked if the string comparison between the %\_tag% variable and your string constant has ever produced a "true" result?

---

<div class="post-metadata">

### Author: ![sylvain.dmde](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@sylvain.dmde](https://community.mp3tag.de/u/sylvain.dmde)
#### Post date: [March 7, 2015, 6:29pm UTC](https://community.mp3tag.de/t/how-to-import-a-file-lyrics-txt/16306/16 "2015-03-07T18:29:14Z")

</div>

Sorry, I do not have enough knowledge of the software to understand you.

I tried the code given so above. All walking, voucher lyrics are at the right place and in the good tag.
