# Export in Txt - %comment% mit Zeilenumbruch

**URL:** https://community.mp3tag.de/t/export-in-txt-comment-mit-zeilenumbruch/55773
**Category:** Allgemein
**Created:** [January 6, 2022, 5:21pm UTC](https://community.mp3tag.de/t/export-in-txt-comment-mit-zeilenumbruch/55773 "2022-01-06T17:21:11Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Maus2022](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@Maus2022](https://community.mp3tag.de/u/Maus2022)
#### Post date: [January 6, 2022, 5:21pm UTC](https://community.mp3tag.de/t/export-in-txt-comment-mit-zeilenumbruch/55773/1 "2022-01-06T17:21:11Z")

</div>

Hallo Zusammen  
und ein Frohes Neues.

Ich möchte eine Zusammenfassung pro Ordner exportieren:

$filename(txt,utf-8)  
Autor: %artist%  
Album: %album%  
Inhalt: %comment%  
Anzahl Dateien: %\_total%

$loop(%\_path%) %title% - %\_length%  
$loopend()

Das Script funktioniert auch so ganz gut. Nur %comment% würde ich lieber mit Zeilenumbrüchen versehen.  
Mit $Replace(%comment%,".", "."&$chr(13)) hat es nicht funktioniert. Am liebsten würde ich auch eine Zeilenumbruch bei ca. 80 Zeichen (Leerzeichen) einfügen.

Hat jemand eine Idee? Geht das überhaubt?

Vielen Dank  
TiaMaus

---

<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: [January 6, 2022, 5:23pm UTC](https://community.mp3tag.de/t/export-in-txt-comment-mit-zeilenumbruch/55773/2 "2022-01-06T17:23:31Z")

</div>

Der klassische Zeilenumbruch ist mit CR und LF, also $char(13)$char(10) (so lautet die Ansteuerung in Mp3tag. $chr ist nicht gültig)

---

<div class="post-metadata">

### Author: ![Maus2022](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@Maus2022](https://community.mp3tag.de/u/Maus2022)
#### Post date: [January 6, 2022, 5:40pm UTC](https://community.mp3tag.de/t/export-in-txt-comment-mit-zeilenumbruch/55773/3 "2022-01-06T17:40:03Z")

</div>

> [@ohrenkino](#):
>
> CR und LF

Danke, aber so ...  
$Replace(%comment%,".", "." & CR & LF)  
funktioniert auch leider nicht. Der Komentar wird wieder nur als Winzeiler ausgegeben.

Gibt es bei Mp3Tag eine For- Schleife?  
For i=1 to $Len(%comment%) Step 80 ... oder so ähnlich

---

<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: [January 6, 2022, 5:53pm UTC](https://community.mp3tag.de/t/export-in-txt-comment-mit-zeilenumbruch/55773/4 "2022-01-06T17:53:17Z")

</div>

Die Abkürzungen CR oder LF gibt es in Mp3tag noch nicht:

> [@$char()-Kürzel für häufige Steuerzeichen](https://community.mp3tag.de/t/char-kurzel-fur-haufige-steuerzeichen/48370):
>
> $char(x): returns the Unicode character for decimal code point x. Für Exportskripte wäre es ganz praktisch und besser lesbar, wenn es ein paar vordefinierte Abkürzungen für [unsichtbare Steuerzeichen](https://de.wikipedia.org/wiki/Steuerzeichen#C0-Steuerzeichen) gäbe: $TAB = $char(9) (wie \t) ␉ $CR = $char(13) (wie \r) ␍ $LF = $char(10) (wie \n) ␊ $NL = $char(13)$char(10) ␤ $NBSP = $char(160)

Du müsstest also schon sowas wie  
`$replace(%COMMENT%,' !*+# ',$char(13),' !§$% ',$char(10),' !"§? ',$char(9))`  
verwenden.

Und hier habe ich noch eine Möglichkeit für den Umbruch gefunden:

> [@Export als csv (Befehle für Tabelle)](https://community.mp3tag.de/t/export-als-csv-befehle-fur-tabelle/8950/7):
>
> $char(13)$char(10) erzeugen einen Zeilenumbruch (Carriage Return und Linefeed). Viele Grüße, Florian

> [@Export als csv (Befehle für Tabelle)](https://community.mp3tag.de/t/export-als-csv-befehle-fur-tabelle/8950/9):
>
> Versuchs mal so: $filename(Excel.tab.csv,utf-16)"Nr."$char(9)"Interpret"$char(9)"Titel" $loop(%\_folderpath%)"%\_counter%"$char(9)"%artist%"$char(9)"$iflonger(%title%,20,$left(%title%,20)$char(13)$char(10)$mid(%title%,21,20),$left(%title%,20))" $loopend()

`$iflonger` ist das Zauberwort

---

<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: [January 6, 2022, 5:56pm UTC](https://community.mp3tag.de/t/export-in-txt-comment-mit-zeilenumbruch/55773/5 "2022-01-06T17:56:38Z")

</div>

> [@Maus2022](#):
>
> $Replace(%comment%,".", "." & CR & LF)

Du kannst Ausdrücke in Konverter\>Tag-Tag testen.  
CR und LF sind die ANSII Bezeichnungen der nicht druckbaren Steuercodes. Du müsstest die schon als Codes wie ich es geschrieben habe

> [@ohrenkino](#):
>
> also $char(13)$char(10)

einfügen.  
Wenn das mit $replace() nicht geht, dann wäre ein $regexp() dran mit `\r\n`

Weitere Informationen zum Export findest du in der Hilfe:

> **[Exporting Tag and File Information – Mp3tag Documentation](https://docs.mp3tag.de/export/)**
>
> Documentation on exporting tag and file information to text-based file formats. Mp3tag is the universal Tag Editor.

Und nein, es gibt keine for..next Schleife (wüsste auch nicht, was die hier bringen sollte).  
Aber vielleicht hilft $mid() - und das steht in der schon gelinkten Hilfe.

---

<div class="post-metadata">

### Author: ![Maus2022](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/5f8ce5/32.png) [@Maus2022](https://community.mp3tag.de/u/Maus2022)
#### Post date: [January 6, 2022, 6:07pm UTC](https://community.mp3tag.de/t/export-in-txt-comment-mit-zeilenumbruch/55773/6 "2022-01-06T18:07:32Z")

</div>

Vielen Danke.  
**$replace(%COMMENT%,'. ','. '$char(13)$char(9)$char(9))**

Bringt das gewünschet ergebnis.

---

<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 5, 2022, 6:07pm UTC](https://community.mp3tag.de/t/export-in-txt-comment-mit-zeilenumbruch/55773/7 "2022-02-05T18:07:41Z")

</div>

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