Community
    • Login

    Find and Replace Multiple Lines of Code for whole directory

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 852 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.
    • Karan MandyaK Offline
      Karan Mandya
      last edited by

      I’m currently working on an assignment and I need to replace multiple lines of code for the whole directory.
      For example, I have a code as:

      <link rel="apple-touch-icon" sizes="180x180" href="">
      <link rel="icon" type="image/png" sizes="32x32" href="">
      <link rel="icon" type="image/png" sizes="16x16" href="">
      <link rel="manifest" href="manifest.json">
      

      Now, I want to replace this code with blank. But I’m not able to do this in “Find in Files” menu as it only finds one line of code at a time and not multiple lines.

      There are thousands of files that needs to be replaced. I tried a plugin but they dont have such feature to replace multiple line in directory (only allows current file).

      Would really appreciate your help in this regard.

      1 Reply Last reply Reply Quote 0
      • Karan MandyaK Offline
        Karan Mandya
        last edited by

        I was able to make it work.

        Using \r \n and \t in extended search mode I was able to put entire code supposed to be replaced in single line and then did a replace in all files pretty easily. Yay!

        JigenJ 1 Reply Last reply Reply Quote 2
        • JigenJ Offline
          Jigen @Karan Mandya
          last edited by

          @Karan-Mandya said in Find and Replace Multiple Lines of Code for whole directory:

          I was able to make it work.

          Using \r \n and \t in extended search mode I was able to put entire code supposed to be replaced in single line and then did a replace in all files pretty easily. Yay!

          1 Reply Last reply Reply Quote 0

          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