# CSV export file empty

**URL:** https://community.mp3tag.de/t/csv-export-file-empty/64306
**Category:** Support
**Created:** [April 5, 2024, 9:25am UTC](https://community.mp3tag.de/t/csv-export-file-empty/64306 "2024-04-05T09:25:06Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![bollemanneke](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/74df32/32.png) [@bollemanneke](https://community.mp3tag.de/u/bollemanneke)
#### Post date: [April 5, 2024, 9:25am UTC](https://community.mp3tag.de/t/csv-export-file-empty/64306/1 "2024-04-05T09:25:06Z")

</div>

Hi everyone,

I’m tyring to export my metadata in CSV format to work with it in Excel. I’ve been fiddling around with the export file, but no matter what I do, all I get is a CSV file without any metadata at all, just the titles of the fields. I am using this:

```auto
$filename(csv,utf-16)Album;Albumartist;Year;Publisher;
$loop(%album%;%albumartist%;%year%;%publisher%;)
$loopend()

```

What did I do wrong?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [April 5, 2024, 9:29am UTC](https://community.mp3tag.de/t/csv-export-file-empty/64306/2 "2024-04-05T09:29:08Z")

</div>

> [@bollemanneke](#):
>
> loop(%album%;%

... you are missing a closing bracket for the $loop() statement.  
Also, You should define in $loop() by which criteria you want to sort the data.  
Finally, between $loop() and $loopend() you declare the output.  
So, I could imagine, that this is better

```auto
$filename(csv,utf-16)Album;Albumartist;Year;Publisher;
$loop(%album%)%album%;%albumartist%;%year%;%publisher%
$loopend()

```

---

<div class="post-metadata">

### Author: ![bollemanneke](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/74df32/32.png) [@bollemanneke](https://community.mp3tag.de/u/bollemanneke)
#### Post date: [April 5, 2024, 11:06am UTC](https://community.mp3tag.de/t/csv-export-file-empty/64306/3 "2024-04-05T11:06:26Z")

</div>

This does indeed work! However, it now repeats the album title depending on the number of tracks that album has. So a 21-track album becomes 21 times the album title.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [April 5, 2024, 11:07am UTC](https://community.mp3tag.de/t/csv-export-file-empty/64306/4 "2024-04-05T11:07:52Z")

</div>

Try

```auto
$filename(csv,utf-16)Album;Albumartist;Year;Publisher;
$loop(%album%,1)%album%;%albumartist%;%year%;%publisher%
$loopend()

```

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [April 5, 2024, 1:16pm UTC](https://community.mp3tag.de/t/csv-export-file-empty/64306/5 "2024-04-05T13:16:29Z")

</div>

Just an ammendment:  
If you have several albums with names like "Best of" or "Gold" or "Greatest hits" then all with the same name would appear as a single album.  
To avoid this you may want to modify `$loop(%album%,1)` to `$loop(%album%%albumartist%,1)` to create more album names.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [May 5, 2024, 1:17pm UTC](https://community.mp3tag.de/t/csv-export-file-empty/64306/6 "2024-05-05T13:17:16Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
