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.
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()
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
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.
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.
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 ").
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
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.
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.