# Nested Loop Sorting Not Working?

**URL:** <https://community.mp3tag.de/t/nested-loop-sorting-not-working/17844>\
**Category:** Export\
**Created:** [April 13, 2016, 3:32pm UTC](https://community.mp3tag.de/t/nested-loop-sorting-not-working/17844 "2016-04-13T15:32:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rko31415](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/f19dbf/32.png) [@rko31415](https://community.mp3tag.de/u/rko31415)\
**Post date:** [April 13, 2016, 3:32pm UTC](https://community.mp3tag.de/t/nested-loop-sorting-not-working/17844/1 "2016-04-13T15:32:02Z")

</div>

Sorting for the second loop (nested loop) in an Export Config doesn't seem to be working. Attached is a .jpg of the Mp3Tag window, the .mte file and the .txt output file.

I would have expected it to 1st sort by Album and then by directory within the album. Instead it's preserving the Mp3tag sort for the 2nd sorting.

recall the discussion at [$loop() for dummies](https://community.mp3tag.de/t/17145/1)

MTE file:  
$filename($getEnv('USERPROFILE')'\desktop\LoopTest.txt',ANSI)$loop(%album%)$loop(%\_directory%)  
%album%|%\_directory%|%\_filename%  
$loopend()$loopend()

Output File:  
Reason and Persuasion|\_AlbumTags|Reason and Persuasion. Thinking Through Three Dialogues....  
Reb YaNYaL Lectures|\_Queued4IPOD|Reb YaNYaL Lectures - The Two Torahs. The Sin of the ...  
Reb YanYal Lectures|\_AlbumTags|Reb YanYal Lectures  
Reb YaNYaL Lectures|\_Queued4IPOD|Reb YaNYaL Lectures - The Limitations of Rationalism

Within the album Reb YaNYal I would have expected \_albumtags to sort to the top above \_Queued4IPOD, but does not.

Is this a bug or am I missing something?  
Thx  
K

I'm still on 2.71 if that matters.

 ![](https://community.mp3tag.de/uploads/default/original/2X/8/87dc80f5ac097dc0dbd48cabb087ae2031a7c65e.jpg)  

[LoopTest.txt](https://community.mp3tag.de/uploads/default/original/2X/2/242c45bf4a0bbf97c67c0d305bedfb588516326c.txt) (347 Bytes)

[LoopTest.mte](https://community.mp3tag.de/uploads/default/original/2X/7/79b0d0af7fc10991bbdba2901a71f81750afdb81.mte) (150 Bytes)

---

<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:** [April 13, 2016, 5:05pm UTC](https://community.mp3tag.de/t/nested-loop-sorting-not-working/17844/2 "2016-04-13T17:05:07Z")

</div>

> [@rko31415](#):
>
> ...  
> MTE file:  
> $filename($getEnv('USERPROFILE')'\desktop\LoopTest.txt',ANSI)$loop(%album%)$loop(%\_directory%)  
> %album%|%\_directory%|%\_filename%  
> $loopend()$loopend()
> 
> Output File:  
> Reason and Persuasion|\_AlbumTags|Reason and Persuasion. Thinking Through Three Dialogues....  
> Reb YaNYaL Lectures|\_Queued4IPOD|Reb YaNYaL Lectures - The Two Torahs. The Sin of the ...  
> Reb YanYal Lectures|\_AlbumTags|Reb YanYal Lectures  
> Reb YaNYaL Lectures|\_Queued4IPOD|Reb YaNYaL Lectures - The Limitations of Rationalism
> 
> Within the album Reb YaNYal I would have expected \_albumtags to sort to the top above \_Queued4IPOD, but does not.  
> ...

If I see it correctly, you have an album called  
Reb YaNYaL Lectures and the other one  
Reb YanYal Lectures

- different in spelling.  
What happens if it is really the same in spelling?

---

<div class="post-metadata">

**Author:** ![rko31415](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/f19dbf/32.png) [@rko31415](https://community.mp3tag.de/u/rko31415)\
**Post date:** [April 14, 2016, 10:37am UTC](https://community.mp3tag.de/t/nested-loop-sorting-not-working/17844/3 "2016-04-14T10:37:08Z")

</div>

Yes curious about the capital N's. I didn't notice them before. I went out to try again, loading up the same episodes and today they are NOT capitalized. Weird.

I cannot replicate the bug with the lower cased spellings, so let's consider this as closed.

Thanks for your attention.

K
