Tag export to bar-delimited text file for DB import

I'm trying to export tag data to a flat text file for import to a database. I was making good progress until I installed V2.83.

Running 2.83

Here is a very simple sample script, limited fields to illustrate my problem:

$filename(LimitedTagList.txt, UTF-8)
$loop(%Genre%)
%albumartist%|%artist%|%album%|%track%|%title%|%genre%|%_Path%|
$loopend()

Here is a sample of the output file:

Various - Doo Wop|Thurston Harris|Just To Be With You 1|1|Little Bitty Pretty One|Doo Wop|F:\MusicFull\MusicPart1\Music_Coffman\Various - It All Started With Doo Wop\Just To Be With You 1\01 Little Bitty Pretty One.mp3|

Various - Doo Wop|The Exciters|Just To Be With You 1|2|Tell Him|Doo Wop|F:\MusicFull\MusicPart1\Music_Coffman\Various - It All Started With Doo Wop\Just To Be With You 1\02 Tell Him.mp3|

Various - Doo Wop|The Fleetwoods|Just To Be With You 1|3|Mr. Blue|Doo Wop|F:\MusicFull\MusicPart1\Music_Coffman\Various - It All Started With Doo Wop\Just To Be With You 1\03 Mr. Blue.mp3|

Various - Doo Wop|The Belmonts|Just To Be With You 1|4|Tell Me Why|Doo Wop|F:\MusicFull\MusicPart1\Music_Coffman\Various - It All Started With Doo Wop\Just To Be With You 1\04 Tell Me Why.mp3|

Since my import process allows NULL fields, each of the above lines that APPEAR to be blank creates a DB row with all NULL fields, leading me to think there must be additional CR/LF characters being generated. When I add enough tag fields to cause lines to wrap, the data rows appear OK except that there is a single blank row following each group of rows for a single record. These 'blank' rows each create a totally blank row (all fields NULL) in my database.

How can I get rid of the blank rows in the export? Thanks for any clues.

Try this:

$filename(LimitedTagList.txt, UTF-8) 
$loop(%Genre%)%albumartist%|%artist%|%album%|%track%|%title%|%genre%|%_Path%|
$loopend()

ryerman

Just an initial test of your code looks really good. The file display at the end of the export appears to have to extra blank lines gone. I'll add back in the rest of the desired fields and try my DB import process again.

I'm a retired DB developer and have a collection of 69000+ tracks that I can better analyze using SQL queries. Collection has to be edited in parts because it blows memory if I load it in MP3Tag and edit all at once.

I appreciate your help. Still learning MP3Tag. Scripting is lots different from SQL.