Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Find and Replace Multiple Lines of Code for whole directory

    Help wanted · · · – – – · · ·
    1
    2
    44
    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 Mandya
      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 Mandya
        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!

        1 Reply Last reply Reply Quote 1
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors