You would need a linebreak in front of the $loop()
$filename(csv,utf-16)Title$char(9)Artist$char(9)Album$char(9)Track$char(9)Year$char(9)Length$char(9)Size$char(9)Modified$char(9)Path$char(9)Filename$char(9)Genre$char(9)Comment$char(9)BPM$char(9)Bitrate
$loop(%_filename_ext%)%title%$char(9)%artist%$char(9)%album%$char(9)%track%$char(9)%year%$char(9)%_length%$char(9)%_file_size%$char(9)%_file_mod_date%$char(9)%_folderpath%$char(9)%_filename_ext%$char(9)%genre%$char(9)%comment%$char(9)%bpm%$char(9)%_bitrate%
$loopend()
and you sort by the %_filename_ext% - you do not say what the
would be
If you want to keep the same order as the one that you have in the filelist then use $loop(1) instead.
If you want to sort by ARTIST; ALBUM and then by TRACK, use $loop(%artist%%album%$num(%track%,2))