IPB

Welcome Guest ( Log In | Register )

> Notice!

Please take a minute to check our Frequently Asked Questions. Use Search to reveal possible related topics.

Also make sure you've read the Forum Guidelines before posting in this forum.

 
Reply to this topicStart new topic
> Pasting lyrics from text files
PaulM
post May 8 2017, 09:39
Post #1


Member


Group: Full Members
Posts: 6
Joined: 8-May 17
Member No.: 23394
Mp3tag Version: 2.82



Hi all,

I am currently working on getting the song's lyrics into the tags of my music collection. So I first started by creating a directory structure, which is equal to those in my music collection. The difference is, that this new directory structure does not contain the music in Ogg Vorbis format, but text files containing the lyrics.
I already collected a quite bunch of lyrics that way (though I'm not finished yet).

But I wonder if, from mp3tag, there is any way to paste tags from a collection of files, some operation like "file content -> tag".

I found that "file content -> tag" works like you select one file and tags are being copied line by line. Now, the problem is of course that my lyrics file contain multiple lines each file, but all lines need to be copied into a single tag field.

So is there any way to select the lyric's directory tree's root level and let mp3tag take the information to tags file by file (by following a path given from format string or sth. like that) ??

I would be grateful for any help on this.

Thanks! smile.gif
Go to the top of the page
 
+Quote Post
ohrenkino
post May 8 2017, 09:47
Post #2


Member


Group: Full Members
Posts: 8876
Joined: 9-December 09
From: Norddeutschland / Northern Germany
Member No.: 11458
Mp3tag Version: 2.83k



ZITAT(PaulM @ May 8 2017, 10:39) *
...The difference is, that this new directory structure does not contain the music in Ogg Vorbis format, but text files containing the lyrics.
I already collected a quite bunch of lyrics that way (though I'm not finished yet).

But I wonder if, from mp3tag, there is any way to paste tags from a collection of files, some operation like "file content -> tag".

I found that "file content -> tag" works like you select one file and tags are being copied line by line. Now, the problem is of course that my lyrics file contain multiple lines each file, but all lines need to be copied into a single tag field.
...

Thanks! smile.gif

If you wan to copy tags from one set of files (perhaps MP3) to others (here perhaps ogg vorbis) it might be an idea to use the function "Copy tag" and "Paste tag": If order and number of source and target files match, you can copy the tags 1:1 in one go.

If you stay with the text file option, then you have to make sure that you have one line per file (one record). You would have to replace the line breaks (carriage return, line feed) with some meta-character like "#".
After the import you replace the "#" again with line breaks (carriage return, line feed).
There is no other way.

Here is a link to a similar problem: https://forums.mp3tag.de/index.php?showtopic=11489

This post has been edited by ohrenkino: May 8 2017, 09:52


--------------------
42 - wie war die Frage / what was the question / quelle était la question
Go to the top of the page
 
+Quote Post
PaulM
post May 8 2017, 09:51
Post #3


Member


Group: Full Members
Posts: 6
Joined: 8-May 17
Member No.: 23394
Mp3tag Version: 2.82



QUOTE (ohrenkino @ May 8 2017, 10:47) *
If you stay with the text file option, then you have to make sure that you have one line per file (one record). You would have to replace the line breaks (carriage return, line feed) with some meta-character like "#".
After the import you replace the "#" again with line breaks (carriage return, line feed).
There is no other way.


So I would do "copy tag" on those text files that contain one line each file? And than I could paste the tag into my music files? Just to make sure that I'm understanding you right.
Go to the top of the page
 
+Quote Post
ohrenkino
post May 8 2017, 09:56
Post #4


Member


Group: Full Members
Posts: 8876
Joined: 9-December 09
From: Norddeutschland / Northern Germany
Member No.: 11458
Mp3tag Version: 2.83k



ZITAT(PaulM @ May 8 2017, 10:51) *
So I would do "copy tag" on those text files that contain one line each file? And than I could paste the tag into my music files? Just to make sure that I'm understanding you right.


I am not sure that we got it in sync:
The "Copy tag" function really copies the tag of one source file (e.g. Waterloo.mp3) and the function "Paste tag" pastes all the tag data to a target file (e.g. Waterloo.ogg).
The good thing is: if you have the whole album in mp3 and you now want to get all the tag data to the ogg files, you simply arrange all the mp3 files and all the ogg files in the same order.
Then select all the mp3 files and copy the tags.
Now select all the ogg files and paste the tags.
Done.


--------------------
42 - wie war die Frage / what was the question / quelle était la question
Go to the top of the page
 
+Quote Post
PaulM
post May 8 2017, 10:34
Post #5


Member


Group: Full Members
Posts: 6
Joined: 8-May 17
Member No.: 23394
Mp3tag Version: 2.82



Ok, I understood that part, but I thought I could extend this scenario to *.txt files, which, as I found out, does not work since *.txt are not shown in mp3tag and adding the file extension in the config does not make the scenario work. And mp3 files or other files, where the lyrics I want to copy are already in, do not exist.

However, your first post gave me the idea which I did now:

Wrote a short console program which just concatenates the contents of all found *.txt files into one file, replacing newlines with the placeholder #CRLF#.

The result was a text file which contains all lyrics of all songs, line by line.

I successfully got them into my ogg files tags by using "file contents -> tags", but now I of course want to replace the #CRLF# placeholder with real newlines again. But I don't know how to express a newline character in mp3tag script language. I currently have:

$replace(%UNSYNCEDLYRICS%,'#CRLF#','fistbump')

where fistbump has to be the real newline I want to get into the tags.
Go to the top of the page
 
+Quote Post
ohrenkino
post May 8 2017, 10:49
Post #6


Member


Group: Full Members
Posts: 8876
Joined: 9-December 09
From: Norddeutschland / Northern Germany
Member No.: 11458
Mp3tag Version: 2.83k



ZITAT(PaulM @ May 8 2017, 11:34) *
... I currently have:

$replace(%UNSYNCEDLYRICS%,'#CRLF#','fistbump')

where fistbump has to be the real newline I want to get into the tags.

See the help for such characters: http://help.mp3tag.de/options_format.html#regexp

Use an action of the type "Replace" for UNSYNCEDLYRICS
Search string: #crlf#
Replace string:$char(13)$char(10)


--------------------
42 - wie war die Frage / what was the question / quelle était la question
Go to the top of the page
 
+Quote Post
DetlevD
post May 8 2017, 11:15
Post #7


Member


Group: Full Members
Posts: 6574
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.83k



QUOTE (PaulM @ May 8 2017, 10:39) *
Hi all, I am currently working on getting the song's lyrics into the tags of my music collection. ... The ... new directory structure does ... contain ... text files containing the lyrics. ... I wonder if ... there is ... some operation like "file content -> tag". ... my lyrics file contain multiple lines each file ... to be copied into a single tag field. ... So is there any way to select the lyric's directory tree's root level and let mp3tag take the information to tags file by file (by following a path given from format string or sth. like that) ?? ...

Mp3tag offers a type of Action, which is called "Import text file".
This action can import text data from a text file into a tagfield of your wish.
Text can be read from one given textfile or ...
by the option of scripting the filename text can be read from different textfiles.

DD.20170508.1215.CEST


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
poster
post May 8 2017, 11:33
Post #8


Member


Group: Full Members
Posts: 1380
Joined: 22-March 09
Member No.: 9241
Mp3tag Version: 2.83k



ZITAT(DetlevD @ May 8 2017, 12:15) *
Mp3tag offers a type of Action, which is called "Import text file".
This action can import text data from a text file into a tagfield of your wish.
Text can be read from one given textfile or ...
by the option of scripting the filename text can be read from different textfiles.

DD.20170508.1215.CEST


As an example:
Action type: Import Text file
Field: UNSYNCEDLYRICS
Filename: %albumartist% - %title%.txt

This filename-definition works if you have placed your lyric-files in the album folders with the tracks and the naming scheme of the lyrics-files is like this. Otherwise you have to define the filename according to your naming scheme.

But you can also take the lyric-files from different paths, like this:
Filename: C:\Lyrics\%albumartist%\%album%\%albumartist% - %title%.txt

If you mark all your music-files and execute such an action the files get the unsyncedlyrics-tag filled from a text-file with this special name in the corresponding folder.

This post has been edited by poster: May 8 2017, 11:35
Go to the top of the page
 
+Quote Post
PaulM
post May 8 2017, 11:56
Post #9


Member


Group: Full Members
Posts: 6
Joined: 8-May 17
Member No.: 23394
Mp3tag Version: 2.82



QUOTE (DetlevD @ May 8 2017, 12:15) *
Mp3tag offers a type of Action, which is called "Import text file".
This action can import text data from a text file into a tagfield of your wish.
Text can be read from one given textfile or ...
by the option of scripting the filename text can be read from different textfiles.

DD.20170508.1215.CEST



QUOTE (poster @ May 8 2017, 12:33) *
As an example:
Action type: Import Text file
Field: UNSYNCEDLYRICS
Filename: %albumartist% - %title%.txt

This filename-definition works if you have placed your lyric-files in the album folders with the tracks and the naming scheme of the lyrics-files is like this. Otherwise you have to define the filename according to your naming scheme.

But you can also take the lyric-files from different paths, like this:
Filename: C:\Lyrics\%albumartist%\%album%\%albumartist% - %title%.txt

If you mark all your music-files and execute such an action the files get the unsyncedlyrics-tag filled from a text-file with this special name in the corresponding folder.



Thanks for these replies. I guess this is the easiest way to get my lyrics into the songs, though I can skip the "concatenate-and-replace" stuff.

Perfectly worked.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd August 2017 - 07:16