Community
    • Login

    how add specific character in the end of the line after one empty line

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 239 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.
    • Reza SaputraR
      Reza Saputra
      last edited by

      Can someone help me, please? I have this file:

      Acanthophippium parviflorum Hassk., Cat. Hort. Bot. Bogor. Alt.: 43 (1844).
      (space)Vietnam, S. Sumatera to Jawa. JAVA, SUMATRA.

      Acanthophippium splendidum J.J.Sm., Natuurk. Tijdschr. Ned.-Indië 58: 360 (1898).
      (space)Sulawesi to SW. Pacific. MALUKU, SULAWESI, PAPUA.
      (space)Acanthophippium papuanum Schltr., Repert. Spec. Nov. Regni Veg. Beih. 1: 371 (1912).
      (space)Acanthophippium vitiense L.O.Williams, Amer. Orchid Soc. Bull. 10: 169 (1941).

      Acanthophippium striatum Lindl., Edwards’s Bot. Reg. 24(Misc.): 41 (1838).
      (space)E. Nepal to Japan (Yakushima) and Lesser Sunda Is. JAVA, NUSA TENGGARA.
      (space)Acanthophippium sinense Rolfe, Bull. Misc. Inform. Kew 1913: 142 (1913).
      (space)Tainia unguiculata Hayata, Icon. Pl. Formosan. 4: 61 (1914). Acanthophippium unguiculatum (Hayata) Fukuy., Bot. Mag. (Tokyo) 48: 301 (1934).
      (space)Acanthophippium simplex Aver., Opred. Orkhid. V’etnama: 109 (1994).

      and I want to turn into this file

      Acanthophippium parviflorum Hassk., Cat. Hort. Bot. Bogor. Alt.: 43 (1844).====
      (space)Vietnam, S. Sumatera to Jawa. JAVA, SUMATRA.

      Acanthophippium splendidum J.J.Sm., Natuurk. Tijdschr. Ned.-Indië 58: 360 (1898).====
      (space)Sulawesi to SW. Pacific. MALUKU, SULAWESI, PAPUA.
      (space)Acanthophippium papuanum Schltr., Repert. Spec. Nov. Regni Veg. Beih. 1: 371 (1912).
      (space)Acanthophippium vitiense L.O.Williams, Amer. Orchid Soc. Bull. 10: 169 (1941).

      Acanthophippium striatum Lindl., Edwards’s Bot. Reg. 24(Misc.): 41 (1838).====
      (space)E. Nepal to Japan (Yakushima) and Lesser Sunda Is. JAVA, NUSA TENGGARA.
      (space)Acanthophippium sinense Rolfe, Bull. Misc. Inform. Kew 1913: 142 (1913).
      (space)Tainia unguiculata Hayata, Icon. Pl. Formosan. 4: 61 (1914). Acanthophippium unguiculatum (Hayata) Fukuy., Bot. Mag. (Tokyo) 48: 301 (1934).
      (space)Acanthophippium simplex Aver., Opred. Orkhid. V’etnama: 109 (1994).

      add “====” only the first line after one empty line.

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

        @Reza-Saputra said in how add specific character in the end of the line after one empty line:

        add “====” only the first line after one empty line

        I think I have a solution. I note that you typed (space), I’m assuming there is an actual space (blank) character there, not the word inside (). Also the blank lines with my solution must be empty, that is no characters at all, even blank ones.

        So it’s a regular expression, so search mode under the Replace function must set to regular expression.
        Find What:(?-s)(\A|\R\R)(.+)
        Replace With:$0====

        See if that works for you. If it doesn’t please supply the examples again, this time inserting them inside of a black box. This is done by inserting them into the posting window, selecting them and then clicking on the </> button immediately above the window. This prevents the posting engine from possibly altering the data.

        Terry

        1 Reply Last reply Reply Quote 2
        • Terry RT
          Terry R
          last edited by Terry R

          @Terry-R said in how add specific character in the end of the line after one empty line:

          I note that you typed (space), I’m assuming there is an actual space (blank) character there, not the word inside ().

          As I said, I wasn’t certain of your statement so I went with my first solution. If the line you want to add ==== to was the ONLY line starting with a character that’s not the space (\x20) then the following should also work.
          Find What:(?-s)^[^\x20].+
          Replace With:$0====

          Terry

          Reza SaputraR 1 Reply Last reply Reply Quote 3
          • Reza SaputraR
            Reza Saputra @Terry R
            last edited by

            @Terry-R said in how add specific character in the end of the line after one empty line:

            @Terry-R said in how add specific character in the end of the line after one empty line:

            I note that you typed (space), I’m assuming there is an actual space (blank) character there, not the word inside ().

            As I said, I wasn’t certain of your statement so I went with my first solution. If the line you want to add ==== to was the ONLY line starting with a character that’s not the space (\x20) then the following should also work.
            Find What:(?-s)^[^\x20].+
            Replace With:$0====

            Terry

            Thank you so much brother. This is works very well.

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