Community
    • Login

    Sorting lines evenly in document

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 3 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • David TalbotD
      David Talbot
      last edited by

      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

      Scott SumnerS 1 Reply Last reply Reply Quote 0
      • Terry RT
        Terry R
        last edited by

        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

        1 Reply Last reply Reply Quote 1
        • Scott SumnerS
          Scott Sumner @David Talbot
          last edited by

          @David-Talbot

          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”.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors