Community
    • Login

    how to arrange in ascending order

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    8 Posts 4 Posters 11.5k Views 1 Watching
    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.
    • Neto BezerraN Offline
      Neto Bezerra
      last edited by

      Hi, guys. I have a doubt: there is how to arrange in increasing order the months and years?
      https://1drv.ms/i/s!AjClnevQ_1BJg7ly2EvPzDLZ00GTQQ

      Thankssss

      1 Reply Last reply Reply Quote 0
      • Binnu Jesudasan GudapatiB Offline
        Binnu Jesudasan Gudapati
        last edited by

        Edit > Line Operations > Sort Lines As Integers Ascending

        1 Reply Last reply Reply Quote 0
        • guy038G Offline
          guy038
          last edited by

          Hello Neto Bezerra and Binnu Jesudasan Gudapati,

          Binnu, I don’t think that’s exactly the sorted list of dates that would like Neto ! Indeed, from the original example list of dates, below :

          11/2011
          04/2013
          08/2012
          01/2011
          05/2014
          03/2013
          10/2012
          

          if we perform the sort Edit > Line Operations > Sort Lines As Integers Ascending, we obtain :

          01/2011
          03/2013
          04/2013
          05/2014
          08/2012
          10/2012
          11/2011
          

          It’s easy that this list is not sorted by year :-(( But you can easily sort a list of dates, if your remember one important rule :

          Write the different items of the date, from left to right, from the less frequently changed item to the more frequently changed item

          In our case, as years changed less frequently than months, we must re-organize the list, according to the template year/month. To do so, just use the following S/R, in Regular expression mode :

          SEARCH : (\d+)/(\d+)

          REPLACE : \2/\1 or $2/$1

          Therefore, from the original example, above, we get, after the S/R, the new list :

          2011/11
          2013/04
          2012/08
          2011/01
          2014/05
          2013/03
          2012/10
          

          Finally, we perform the classical sort Edit > Line Operations > Sort Lines Lexicographically Ascending, to obtain the well-sorted list ( to my mind ! ), below :

          2011/01
          2011/11
          2012/08
          2012/10
          2013/03
          2013/04
          2014/05
          

          Best Regards,

          guy038

          1 Reply Last reply Reply Quote 0
          • Scott SumnerS Offline
            Scott Sumner
            last edited by

            Perhaps the OP needs the data to be in the
            MM/YYYY
            format after the sort.

            Simply performing again guy038’s regex search and replace will do that.

            1 Reply Last reply Reply Quote 1
            • guy038G Offline
              guy038
              last edited by

              Hi Scott,

              Oh yes ! I forgot that final point ! Thanks for your reply !

              guy038

              1 Reply Last reply Reply Quote 0
              • Neto BezerraN Offline
                Neto Bezerra
                last edited by

                Thanks so much, guys!!!

                1 Reply Last reply Reply Quote 0
                • Neto BezerraN Offline
                  Neto Bezerra
                  last edited by

                  Guys, there is a possibility to put some kind of marking or space for when happening a break in the sequence?
                  Example:

                  2011/03
                  2011/04
                  2011/05

                  2011/07
                  2011/08

                  2012/01
                  2012/02

                  Thank you very much in advance!!

                  1 Reply Last reply Reply Quote 0
                  • Scott SumnerS Offline
                    Scott Sumner
                    last edited by

                    You need to do some programming in order to achieve that.

                    1 Reply Last reply Reply Quote 0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors