Community
    • Login

    Rearrange the word and numbers at the beginning of each line

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 3 Posters 3.1k 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.
    • Владимир ТаранчукВ
      Владимир Таранчук
      last edited by

      This text was written with the help of on Google Translate, so sorry for any errors.
      I have one text in which each line whitten the name of the fiction, date, rating, number of comments and the number of favorites. I need to take the word “favs” and numbers (specifically, it has the form (Favs: 2457 or Favs: 547)) and rearrange in the beginning of each line. How to do it?

      1 Reply Last reply Reply Quote 0
      • gerdb42G
        gerdb42
        last edited by

        Open Search->Replace. Make sure Search Mode is set to “Regular Expression”. Search for ^Favs: (\d+). Replace with $1 Favs:. This will search for the term “Favs: " at the beginning of a line followed by a sequence of digits. The digits part \d+ is put in brackets so it will be retained for use in replacement. In the replacement $1 is a placeholder for the digits retained in search. The text " Favs:” will be added as well (change to your liking).

        1 Reply Last reply Reply Quote 0
        • Владимир ТаранчукВ
          Владимир Таранчук
          last edited by

          Unfortunately, nothing happened. It shows that 0 occurrense was replaced. Here is an example of the 2 lines of text.

          A Different Halloween by robst reviews Could a chance meeting change history? What would a different Halloween in 1981 mean for wizarding Britain? Harry Potter - Rated: T - English - Chapters: 20 - Words: 124549 - reviews : 4042 - Favs: 7160 - Follows: 4229 - Updated: May 26 2012 - Published: Oct 31 2010 - [Harry P. Hermione G.] - Complete

          A Different Universe by dunuelos reviews Offshoot of “Stories of the Lone Traveller” from this site. Harry with help from an alternate version of himself begins to take back his life. There will be some M material in this one. Lemons found AFFO story ID 600098990. Harry Potter - Rated: M - English - Romance - Chapters: 23 - Words: 91164 - reviews : 617 - Favs: 1439 - Follows: 1887 - Updated: Aug 19 2014 - Published: Mar 14 2010 - Harry P. Hermione G.

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

            Why didn’t you provide your sample lines of text when you first asked the question?

            Владимир ТаранчукВ 1 Reply Last reply Reply Quote 0
            • Владимир ТаранчукВ
              Владимир Таранчук @Scott Sumner
              last edited by

              @Scott-Sumner I’m sorry, I did not think about it. I gave an example of text (2 lines of text).

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

                If you follow basically what gerdb42 said to do, and use the following, it should work:

                Find what: ^(.+?)(Favs: \d+ - )(.+)
                Replace with: \2\1\3

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