• Login
Community
  • Login

how to arrange in ascending order

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
8 Posts 4 Posters 10.7k 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.
  • N
    Neto Bezerra
    last edited by Sep 11, 2016, 9:55 PM

    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
    • B
      Binnu Jesudasan Gudapati
      last edited by Sep 12, 2016, 5:56 AM

      Edit > Line Operations > Sort Lines As Integers Ascending

      1 Reply Last reply Reply Quote 0
      • G
        guy038
        last edited by Sep 13, 2016, 11:50 AM

        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
        • S
          Scott Sumner
          last edited by Sep 13, 2016, 12:09 PM

          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
          • G
            guy038
            last edited by Sep 13, 2016, 12:26 PM

            Hi Scott,

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

            guy038

            1 Reply Last reply Reply Quote 0
            • N
              Neto Bezerra
              last edited by Sep 19, 2016, 1:09 AM

              Thanks so much, guys!!!

              1 Reply Last reply Reply Quote 0
              • N
                Neto Bezerra
                last edited by Oct 2, 2016, 6:25 PM

                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
                • S
                  Scott Sumner
                  last edited by Oct 2, 2016, 6:56 PM

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

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