Line based text exports and line breaks

Hello everyone,

I've looked through the documentation and the export sub-forum, but I can't find a solution to my problem. It's probably something simple that I have overlooked or maybe what I want to do is not possible.

When doing a line based export, say a CSV file, containing a lot of fields and field transformations it would be nice to be able to break up the export definition of a line into multiple lines. Let me explain.

A simple export could look like this.


Now, imagine that I want to have some 30+ fields, some plain ones and some calculated/transformed ones. At this point the mte file becomes a maintenance nightmare. Consider a simple example of just a few fields.


With all those fields it's hard to tell which commas are part of function calls and which are meant for the final output, and it takes some careful editing to get all the double quotes right.

What I'm looking for is the possibility to split a multi-parameter method across multiple lines and to have a new method, e.g. $concat(x,y), that would concatenate the two strings x and y. With this I would be able to do something like the following.

$loop(%_path%)$concat("$replace(%artist%,","")", $concat(',',
$concat("$replace(%album%,","")", $concat(',',
$concat(%year%, $concat(',',
$concat(%track%, $concat(',',
$concat("$replace(%title%,","")", $concat(',',
$concat(%_length_seconds%, $concat(',',
$concat("$replace(%comment%,","")", $concat(',',
$concat(%_file_size_bytes%, $concat(',',
$concat(%_bitrate%, $concat(',',

Having typed the above, I realize that a better request would be to have a method that would eat a carriage return/line feed pair (I'm going to call it eatcrlf in my examples). This would turn the above to something like the following.


Having typed the above I realize a better yet request would be for a crlf-less mode and a $crlf() function. This would be the reverse to the above; carriage return/line feed pairs would be eaten by default and $crlf() would insert one such pair into the output. Consider the following ("eatcrlf" is just a made up example, of course).


Have I simply missed something in the documentation that I could use to do what I want, or is this a feasible feature request? Thanks in advance for any help.

EDIT: I found that the following works for me, I was wrong about the functions not being able to be defined across multiple lines in the mte file. I can work with this for now. I'm sorry you had to read through all of the above.


That's a nice trick, still working in Mp3tag v2.58!

01: $filename($getEnv('USERPROFILE')'\Desktop\Mp3tag.Test.txt',UTF-8)$puts(

02: )'Artist,Album,Year,Track,Title,Length,Comment,Size,Bitrate,VBR'
03: $loop(%_path%)$puts(
04: )'"'$replace(%ARTIST%,'"','""')'"'$puts(
05: )',"'$replace(%ALBUM%,'"','""')'"'$puts(
06: )','%YEAR%$puts(
07: )','$ifgreater($strstr(%TRACK%,'/'),0,'"'%TRACK%'"',%TRACK%)$puts(
08: )',"'$replace(%TITLE%,'"','""')'"'$puts(
09: )','%_length_seconds%$puts(
10: )',"'$replace(%COMMENT%,'"','""')'"'$puts(
11: )','%_file_size_bytes%$puts(
12: )','%_bitrate%$puts(
13: )',"'%_vbr%'"'
14: $loopend()