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



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



  • @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



  • @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



  • @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.


Log in to reply