Community
    • Login

    add text in multiple files

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 755 Views 1 Watching
    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 Offline
      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 Offline
        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 Offline
          Stefano Schiavini
          last edited by

          thank you,

          exactly what I needed.
          works great.

          Stefano

          1 Reply Last reply Reply Quote 1

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors