Community
    • Login

    add text in multiple files

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 433 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.
    • Stefano SchiaviniS
      Stefano Schiavini
      last edited by

      Hi,
      I need to insert a text, in multiple files.

      The text is always the same, and the position where I want to insert it is also the same in each file.

      The text is:

      <gmd:descriptiveKeywords>
       <gmd:MD_Keywords>
       <gmd:keyword>
       <gco:CharacterString>open data</gco:CharacterString>
       </gmd:keyword>
       </gmd:MD_Keywords>
      </gmd:descriptiveKeywords>
      

      and I want to put it after the line with this text:

      </gmd:resourceMaintenance>
      

      I think I should use the find and replace with regex, but I don’t know how.

      Stefano

      Alan KilbornA 1 Reply Last reply Reply Quote 2
      • Alan KilbornA
        Alan Kilborn @Stefano Schiavini
        last edited by

        @Stefano-Schiavini

        Regular expressions (regex) is the way to go:

        Search for: </gmd:resourceMaintenance>(\R)

        and Replace with: ${0}<gmd:descriptiveKeywords>${1} <gmd:MD_Keywords>${1} <gmd:keyword>${1} <gco:CharacterString>open data</gco:CharacterString>${1} </gmd:keyword>${1} </gmd:MD_Keywords>${1}</gmd:descriptiveKeywords>${1}

        1 Reply Last reply Reply Quote 3
        • Stefano SchiaviniS
          Stefano Schiavini
          last edited by

          thank you,

          exactly what I needed.
          works great.

          Stefano

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