Need help w/ Export file


I'm trying to build a working csv export file and I have two problems:

When I open it in Excel the headers are correct but the first column is missing so all the following columns get shifted one column to the left. here's my file:


Secondly how do I get MP3Tag to use the folder name as the exported filename?


This should not happen, because the column structure is already given by the header line.
You have to "import" the CSV file into Excel, standard open might not work.

Example export script:

1: $filename($getEnv('USERPROFILE')'\Desktop\Mp3tag.Export.semicolon.'%_directory%'.csv',UTF-16)'"Track";"Title";"Directory";"Length";"Album";"Year";"Path"'

2: $loop(%_path%)'"'$num(%TRACK%,1)'";"'%TITLE%'";"'%_directory%'";"0:0:'%_length_seconds%'";"'%ALBUM%'";'%YEAR%'";"'%_path%'"'
3: $loopend()


Drop the semicolon at the line ends so the Excel importer sees the EOL (Chr(13)) and 'knows' to start a new line of data.

Thanks for your replies.

I deleted the ";" at the end of the header line in my custom export file and that did the trick. Thanks! But i'm still baffled because the sample csv.mte has the ";" at the end of the header line.

1: $filename($getEnv('USERPROFILE')'\Desktop\Mp3tag.Export.semicolon.'%_directory%'.csv',UTF-16)

Ok I substituted

(csv,utf-16)but that just resulted in a csv file full of garbage.

Let me clarify - what i'm hoping to find is the correct syntax for a variable that will cause MP3Tag to use the MP3 folder name as the name of the csv file.


I am used to output CSV text in ANSI character encoding to Excel.
I don't know why you want to apply the UTF-16 character encoding.

The Mp3tag placeholder for the folder name of the current file is called "%_directory%".
See Mp3tag help manual for further export placeholders.

When the placeholder %_directory% is applied within the filename part of the export script's $filename function, then %_directory% contains the foldername of the first file in the given file list.
This works for me since years.
Try again.

There is no problem with the trailing semicolon when importing CSV with text lines having a trailing semicolon (with german Excel 2007).

Make sure to import the CSV file by the Excel Textconverter Assistent.
There are additional options for the CSV import, especially about the character encoding and the data format for the columns.


Ok I tried $filename(%_directory%,csv,utf-16) at the beginning of the mte script but that did nothing.

Finally the light dawned. I needed to add "%_directory%" the the "filename" field in the dialog that opens so that you can choose which script to use before you export. Duh! Works fine now.


Yes, I have forgotten to mention. that there is a quirk in the dialog "Export", so that the filename of the export script is not proper updated, when changed manually in the script.
Moving the selection bar up and down in the picklist should update the dialog field.
I do this already automatically, without thinking.


$filename(%_directory%,csv,utf-16) is wrong syntax

$filename(%_directory%.csv,utf-16) should work (a dot before csv)