Sorting lines evenly in document
-
Hi,
I have a music playlist file of 6000 songs that I am manually selecting artists and sorting, or distributing, evenly through the document.
It is quite laborious.
Is there a way to select all lines of one artist and then distribute them at a set line interval e.g. every 50 lines?
Thanks,
David -
I’d have to suggest not with a regular expression (regex). You see regex doesn’t have a calculator function builtin so cannot make numerical calculations of the type required.
Notepad++ does however have other plugins, MathPad etc. See
http://docs.notepad-plus-plus.org/index.php?title=Plugin_Central
for details. One of those might fit your need, I haven’t looked at any so cannot comment.I would say though that if you sorted the music based on song title it would give a somewhat random distribution of songs. Of course it won’t be perfect but I’d suggest most artists songs would be kept at least 2-3 songs apart so in playing it would sound random. And maybe random might even be better than evenly distributed where listeners would know every nth song would be by the same artist.
Terry
-
Although it doesn’t help with the fixed-interval distribution, these links might assist with doing some random “sorting”:
-
https://notepad-plus-plus.org/community/topic/14129/sort-file-removing-duplicates-possible (this is a base link which doesn’t discuss random sorting per se, but it leads to the following link, which offers it as a feature)
-
@Claudia-Frank 's “Sorter” Pythonscript: https://gist.github.com/ClaudiaFrank/3b5a346b86b5391c67f2f96845ff7ecd
Really though, the OP is a rather specific and esoteric need…and that usually ends up with someone telling you to not depend upon Notepad++ being able to help, but rather grabbing a programming language of your choice and “having at it”.
-