Export Ratings to Textfile

Hi there,

I would like to export all tracks which containing Ratings.
Actually I'm using this loop in my export script.

$filename($regexp(%_folderpath%,'[^\\\\]'*\\\\$,)traktor_ratings.txt,utf-8)$loop(%_path%)$if($regexp(%rating%,traktor@native-instruments.de|(.*)|(.*),),%_path%','%rating%,)
$loopend()

How I can suppress the script writeing an empty line for each track with no rating?

thanks

What about filtering the files before you use the export?
%rating% PRESENT