# Placing comment in export mte (for csv)

**URL:** https://community.mp3tag.de/t/placing-comment-in-export-mte-for-csv/54357
**Category:** Export
**Created:** [September 13, 2021, 1:53am UTC](https://community.mp3tag.de/t/placing-comment-in-export-mte-for-csv/54357 "2021-09-13T01:53:12Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![murspieg](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@murspieg](https://community.mp3tag.de/u/murspieg)
#### Post date: [September 13, 2021, 1:53am UTC](https://community.mp3tag.de/t/placing-comment-in-export-mte-for-csv/54357/1 "2021-09-13T01:53:12Z")

</div>

Tried searching most of the help pages, but only found reference to the comment tag. Is it possible to place a comment within the export mte to explain the code? Tnx

---

<div class="post-metadata">

### Author: ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)
#### Post date: [September 13, 2021, 4:56am UTC](https://community.mp3tag.de/t/placing-comment-in-export-mte-for-csv/54357/3 "2021-09-13T04:56:11Z")

</div>

You can embed the code-line in `<!-- -->`

`<!-- This is my explanation for the code -->`

---

<div class="post-metadata">

### Author: ![murspieg](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@murspieg](https://community.mp3tag.de/u/murspieg)
#### Post date: [September 13, 2021, 2:03pm UTC](https://community.mp3tag.de/t/placing-comment-in-export-mte-for-csv/54357/4 "2021-09-13T14:03:11Z")

</div>

To be clear(er), I want the comment to **not** appear in the generated output; the output should be unaffected by the comment.

---

<div class="post-metadata">

### Author: ![murspieg](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@murspieg](https://community.mp3tag.de/u/murspieg)
#### Post date: [September 13, 2021, 2:07pm UTC](https://community.mp3tag.de/t/placing-comment-in-export-mte-for-csv/54357/5 "2021-09-13T14:07:01Z")

</div>

Thanks for the reply. For me, this is written to the output.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [September 13, 2021, 2:26pm UTC](https://community.mp3tag.de/t/placing-comment-in-export-mte-for-csv/54357/6 "2021-09-13T14:26:33Z")

</div>

If I insert the above comment line in one of the example export scripts like this:

```auto
$loop(%_filename_ext%)
		<tr>			
			<td$if($odd(%_counter%), class="odd",)>$meta(artist)</td>
            <!-- This is my explanation for the code -->			
			<td$if($odd(%_counter%), class="odd",)>%title%</td>
            <td$if($odd(%_counter%), class="odd",)>%album%</td>
		</tr>
$loopend()

```

The comment will NOT appear in the export. If you show us your code, it will be easier for us to help.

---

<div class="post-metadata">

### Author: ![murspieg](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@murspieg](https://community.mp3tag.de/u/murspieg)
#### Post date: [September 13, 2021, 2:42pm UTC](https://community.mp3tag.de/t/placing-comment-in-export-mte-for-csv/54357/7 "2021-09-13T14:42:22Z")

</div>

Aha, I neglected to mention this is for csv output, not html. Makes all the difference in the world. A snippet:

```auto
$filename(csv,utf-16)Filename,Path,Artist,Title,Album,Genre,Comment
$loop(%_filename_ext%)"$replace($regexp($regexp($regexp(%_filename_ext%,\r\n,; ),\r,; ),\n,; ),",)",$puts(a
,)"$replace($regexp($regexp($regexp(%_folderpath%,\r\n,; ),\r,; ),\n,; ),",)",
...
$loopend()

```

ohrenkino had suggested a mis-use of $puts into a dummy variable, but that solution had a blank line in the output.  
Thanks for the help!

---

<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: [September 13, 2021, 4:20pm UTC](https://community.mp3tag.de/t/placing-comment-in-export-mte-for-csv/54357/8 "2021-09-13T16:20:07Z")

</div>

> [@murspieg](#):
>
> but that solution had a blank line in the output.

That is mainly a problem of how you format the code - unfortunately, the layout of the code is also the layout of the output. So if you put the comment into an extra line, then this still acts as extra line in the output. The only way around it would be to keep the misused $puts() in the same line as the code.

---

<div class="post-metadata">

### Author: ![murspieg](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/858c86/32.png) [@murspieg](https://community.mp3tag.de/u/murspieg)
#### Post date: [September 13, 2021, 4:41pm UTC](https://community.mp3tag.de/t/placing-comment-in-export-mte-for-csv/54357/9 "2021-09-13T16:41:40Z")

</div>

Thanks, that's helpful.  
To store examples so it can be used by others:

```auto
$filename(csv,utf-16)Filename,Path,Artist,Title,Album,Genre,Comment
$puts(for_comment,Misused puts() used to show a comment here)$loop(%_filename_ext%)"$replace($regexp(

```

or

```auto
$filename(csv,utf-16)Filename,Path,Artist,Title,Album,Genre,Comment
$loop(%_filename_ext%)"$replace($regexp( ...,$puts(a
,)"$puts(for_comment,Misused puts() shows comment for following code)"$replace($regexp(%artist%,...)"

```

Code for comment must be in-line with rest of code. Thanks @ohrenkino
