# An odd issue with the export \> APPEND data

**URL:** https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764
**Category:** Support
**Created:** [August 15, 2012, 8:07pm UTC](https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764 "2012-08-15T20:07:50Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![kittmaster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kittmaster/32/14793_2.png) [@kittmaster](https://community.mp3tag.de/u/kittmaster)
#### Post date: [August 15, 2012, 8:07pm UTC](https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764/1 "2012-08-15T20:07:50Z")

</div>

Couple of things, first, I'm having an issue when I export data a second time to the same file, it is adding a funky "y" to the prepended data.

Second, is there way to prevent the fixed constants from being exported more than once? Row 1 is the master row for all the other rows 2\>infinity.....I don't need the row one repeated over and over......is there a way to trap on that if exists don't append? I only want row 1 once, and all append data in sequential row below.

I've attached the images here for issue 1....hopefully someone can help with issue 2.

thanks!

![](http://www.kittmaster.com/images_random/tag1.png)

![](http://www.kittmaster.com/images_random/tag2.png)

---

<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: [August 16, 2012, 3:11am UTC](https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764/2 "2012-08-16T03:11:24Z")

</div>

> [@](#):
>
> Second, is there way to prevent the fixed constants from being exported more than once?

You would need a second report definition that does not have the line with output text before the $loop statement.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [August 16, 2012, 4:12am UTC](https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764/3 "2012-08-16T04:12:15Z")

</div>

> [@kittmaster](#):
>
> Couple of things, first, I'm having an issue when I export data a second time to the same file, it is adding a funky "y" to the prepended data. ... Second, is there way to prevent the fixed constants from being exported more than once? ...

I do not know if I understand the problem in the right way.  
You should show us your report script.  
At 1.  
Perhaps the one and only leading BOM has been added again when appending further text to an existing text file?  
At 2.  
See manual how the function $loop is explained.  
There is a parameter, which controls whether the loop should be run only once resp. as many as items exists.  
Loops can be applied nested.

DD.20120816.0812.CEST

---

<div class="post-metadata">

### Author: ![kittmaster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kittmaster/32/14793_2.png) [@kittmaster](https://community.mp3tag.de/u/kittmaster)
#### Post date: [August 16, 2012, 10:15am UTC](https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764/4 "2012-08-16T10:15:52Z")

</div>

The image shows the "Y" with 2 dots over it when the I do a second export and MP3TAG is appending to the document. I don't think that should be there as it's not part of my tag structures. I will take another look at the $loop features and see if I can figure out the "only export the first line once issue"....right now its a continuous loop for all files. Here is the export code:

```
$filename(csv,utf-8)product_sku product_name category_path product_desc published product_s_desc product_price product_override_price max_order_level min_order_level product_in_stock file_url file_url_thumb product_params
$loop(%_path%)$replace($left(%ARTIST%,1)$left(%initialkey%,2)$left(%BPM%,2)$left(%ALBUM%,3)$left(%YEAR%,4)$left(%TITLE%,4)$num(%_counter%,6), ,X,',',X,'(',X,')',X,'%',X,'',X,.,X,-,X,'$',X,!,X,#,X,&,X,~,X,^,X,|,X) %artist%--%title% $if($isdigit($left(%ARTIST%,1)),ABP Alphabetical Music List/NUMBERS,ABP Alphabetical Music List/$upper($left(%ARTIST%,1))) %artist%--%title%--%album%--%year% (Artist, Title, Album, Year) 1 %year% 0.00001 0.00001 5 1 10000000 images/stories/virtuemart/product/$lower($replace(%artist%-%title%-%album%-%track%-$left(%ARTIST%,1)$left(%initialkey%,2)$left(%BPM%,2)$left(%ALBUM%,3)$left(%YEAR%,4)$left(%TITLE%,4),$,S,#,X,'%', percent,!,X,?,X,", inch,:,X,/,X,\,X)-FRONT COVER.jpg) images/stories/virtuemart/product/$lower($replace(%artist%-%title%-%album%-%track%-$left(%ARTIST%,1)$left(%initialkey%,2)$left(%BPM%,2)$left(%ALBUM%,3)$left(%YEAR%,4)$left(%TITLE%,4),$,S,#,X,'%', percent,!,X,?,X,", inch,:,X,/,X,\,X)-FRONT COVER_90x90.jpg) min_order_level="0"|max_order_level="0"|
$loopend()
```

---

<div class="post-metadata">

### Author: ![kittmaster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kittmaster/32/14793_2.png) [@kittmaster](https://community.mp3tag.de/u/kittmaster)
#### Post date: [August 16, 2012, 10:23am UTC](https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764/5 "2012-08-16T10:23:58Z")

</div>

I just want to add, while this may look like I am reselling MP3 files through an online store I am not. I am using virtualmart for Joomla! I can provide info for the site login if you need to see for yourself. I've hacked the crap out of it to be an online playlist generator......nothing more.

Thanks

---

<div class="post-metadata">

### Author: ![kittmaster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kittmaster/32/14793_2.png) [@kittmaster](https://community.mp3tag.de/u/kittmaster)
#### Post date: [August 21, 2012, 3:40pm UTC](https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764/6 "2012-08-21T15:40:32Z")

</div>

> [@ohrenkino](#):
>
> You would need a second report definition that does not have the line with output text before the $loop statement.

Do you happen to have an example of this? I can't find anything in the forums or I'm not searching it correctly.

Thanks

---

<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: [August 21, 2012, 4:37pm UTC](https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764/7 "2012-08-21T16:37:02Z")

</div>

> [@kittmaster](#):
>
> Do you happen to have an example of this?

If you have a look at the example you supplied in post #4

```
$filename(csv,utf-8)product_sku product_name category_path product_desc published product_s_desc product_price product_override_price max_order_level min_order_level product_in_stock file_url file_url_thumb product_params
$loop(%_path%)$replace($left(%ARTIST%,1)$left(%initi .....

```

you simply leave out the part between filename and $loop:

```
$filename(csv,utf-8)
$loop(%_path%)$replace($left(%ARTIST%,1)$left(%initi....

```

as that line that I now left out is nothing but plain text to supply the column headers.

---

<div class="post-metadata">

### Author: ![kittmaster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kittmaster/32/14793_2.png) [@kittmaster](https://community.mp3tag.de/u/kittmaster)
#### Post date: [August 21, 2012, 5:55pm UTC](https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764/8 "2012-08-21T17:55:50Z")

</div>

I actually need the first row for the delimiter import. So I'd have to then insert a row and them try to paste those values in.

Is there a way for the loop to look and see if there is data in the first cell and if so, skip that initial population, and then just do a second loop and append the data?

My biggest concern with the append part is the "Y" with the two dots over it.....that is repeatable on every append of the document.

---

<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: [August 21, 2012, 6:12pm UTC](https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764/9 "2012-08-21T18:12:40Z")

</div>

> [@kittmaster](#):
>
> I actually need the first row for the delimiter import.... So I'd have to then insert a row and them try to paste those values in.

The delimiter is also between the variables - the text at the beginning could be left out if you want to append.

> [@kittmaster](#):
>
> Is there a way for the loop to look and see if there is data in the first cell and if so, skip that initial population, and then just do a second loop and append the data?

Either you are in the loop or not. Any export does not know anything about other exports you have done before.

> [@kittmaster](#):
>
> My biggest concern with the append part is the "Y" with the two dots over it.....that is repeatable on every append of the document.

You should look at the text document you have created as it looks to me as if the definition has an incomplete line.  
if you enter a $chr(13)$chr(10) after the last $loop() then you might get an extra line but I hope the "y" will disappear.

---

<div class="post-metadata">

### Author: ![dano](https://community.mp3tag.de/user_avatar/community.mp3tag.de/dano/32/6_2.png) [@dano](https://community.mp3tag.de/u/dano)
#### Post date: [August 21, 2012, 6:28pm UTC](https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764/10 "2012-08-21T18:28:47Z")

</div>

> [@kittmaster](#):
>
> My biggest concern with the append part is the "Y" with the two dots over it.....that is repeatable on every append of the document.

This looks like a byte order marker. You can disable it at Options \> Export  
You need it when a new file is written to indicate the text encoding, but when you append data it should be omitted.  
Unfortunately the program doesn't do it automatically.

---

<div class="post-metadata">

### Author: ![kittmaster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kittmaster/32/14793_2.png) [@kittmaster](https://community.mp3tag.de/u/kittmaster)
#### Post date: [August 21, 2012, 11:37pm UTC](https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764/11 "2012-08-21T23:37:52Z")

</div>

> [@dano](#):
>
> This looks like a byte order marker. You can disable it at Options \> Export  
> You need it when a new file is written to indicate the text encoding, but when you append data it should be omitted.  
> Unfortunately the program doesn't do it automatically.

Turning off write BOM did the trick to get rid of the Y issue

Thanks!

---

<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: [February 9, 2026, 12:24pm UTC](https://community.mp3tag.de/t/an-odd-issue-with-the-export-append-data/13764/12 "2026-02-09T12:24:00Z")

</div>


