Need to export a csv file of a list of songs!


#1

I've done this dozens of times on another PC but I can't figure out how to write a new export script to do this on a new laptop that I have here. I'm not in my home office, but I have to get this done right away. I'm panicked, as I need to upload the CSV file now.

I know there's a sample script in the export list of ready-made scripts, but I can't get it to work. I have a list of 46 songs with track number, duration, artist, title, album name, year released and label. It's a total of 47 records including the header row. I need to get it into an Excel file so that I can upload it to a web-based site.

dennisb@kvmr.org


Simple export of title, composer & comments tag - HELP!
#2

What do you mean? You don't know how to export? -> Select the files, select the export script, execute the script, done.

Or you get strange results in some fields as the included data contains commas and/or semikolons?
Anyway: show us the script that you use and tell us which fields you want to export.
Here is a very plain export script that uses the tab character as field separator - usually works better than commas:
$filename(csv,utf-16)Interpret$char(9)Composer$char(9)Album$char(9)Pfad $loop(%artist%)%artist%$char(9)%composer%$char(9)%album%$char(9)%title%$char(9)%_path%
$loopend()


#3

I don't understand the portion of text in the middle row above. What is Pfad and why does %artist% appear twice?


#4

Here is the script I've been trying. I modeled it after the CSV example script.

$filename(csv,utf-8)TN;LENGTH;ARTIST;TITLE;ALBUM;YEAR;LABEL;
$loop(%_path%)$num(%tracknumber%,2);%length%;%artist%;%title;%album%;%year%;%label%;$loopend();


#5

The $loop() statement defines by which field the whole export should be sorted (in this case by the field %artist%)
That what is outside the $loop() is the instruction to output the contents of the referenced field. So you have to use %artist% to sort by artist and use %artist% to see what is in the field artist.
The $char(9) is the character code for the tab character which works well as field separator


#6

I think that should be %track% instead of %tracknumber%


#7

These are flac files, The field name for the track number is tracknumber.


#8

so, what is it that does not work?


#9

and what is "Pfad" in the script?


#10

The script runs but the Excel file that opens has strange numeric characters at the beginning of each line, and the field values are not separated into column. Some fields are missing as well.


#11

Also, the rows in the spreadsheet are in random order rather than in the order listed in the mp3tag rows.


#12

If you sort by path and the path is the same for all, the you get a random order.
Use
$loop(1) instead of $loop(%_path%)
This copies the order that is shown in the files list.


#13

This depends on what you local excel interprets as "comma": whether it is really a comma or the semicolon.
Currently, you use the semicolon, perhaps the comma is better (but this will be problematic if the data in the fields contains commas as well. THen you would have to enclose the field names in ").


#14

I have a working script on the computer in my home office, but that's 50km from here, it's night time and I cannot drive at night. I just can't duplicate it here.

I use another script successfully here to export a text tile. I was smart enough to store that one in my dropbox. Here it is:

$filename(txt,utf-8)TRACK NUMBER / DURATION / ARTIST / TITLE / ALBUM / YEAR / LABEL

$loop(%_path%)$num(%tracknumber%,2) / %length% / %artist% / %title% / %album% / %year% / %label%

$loopend()

It yields a very nice double-spaced, easily read list of the songs that I also need to upload/import as a csv file (minus the spaces and "/" characters. As I recall, my working CSV script on the other PC looks very similar to this one.


#15

ecxept of course the fields are not double-spaced.


#16

What is wrong with this csv export script?

$filename(csv,utf-8)TN,LENGTH,ARTIST,TITLE,ALBUM,YEAR,LABEL
$loop(%_path%)$num(%tracknumber%,2),%length%,%artist%,%title%,%album%,%year%,%label%
$loopend()


#17

I know about the need for "s if there are commas in the values.


#18

I get proper results when I use a valid separator and the field %_length%.
If you don't, then you would have to show us the original data, the actual output and the intended output.


#19

That script worked for me. Thank you for all of the time and effort you put in to helping me! I really appreciate it.

Dennis, aka "d2b"


#20

We create a FLAC tag with the name LENGTH from %_length%.