Finding and deleting multiple lines

  • Rich

    Rich - 2012-10-24

    I have a huge folder containing 800+ html files.  They all contain some javascript (multiple lines) that need to be deleted.  The lines are the same in all of the files.  I know that I can search all of the files in that folder, but is there any way to delete the line in each of the files en masse rather than opening each one individually and editing it.  Thanks.

  • fb16

    fb16 - 2012-10-24


    I'm not sure if you're aware of the feature "Search > Find in files…" (CTRL + SHIFT + F), anyway, it'll allow you to find and replace text, in multiple files at once.

    It works like the regular search and replace text in the opened document, only that you're going to edit also the files you specified in the path, without the annoyance of having to open them, one by one.

    Best regards

  • Closed Office

    Closed Office - 2012-10-30

    I've never done it with about 60 files, but this might help. You do have to open all of them but just once. Highlight all the files you want to open and right click > edit with np++.

    Then ctrl + h (replace), paste in one of the lines, > tab (to shift to the replace box) > press the del key, and then click on 'replace all in all opened documents.' The del will stay in the replace box, so you just have to paste in each line of text to be deleted, then press the 'replace all in all opened documents' key. It will tell you how many replacements (deletes) were made.

    Hope I understood the question and that wasn't too basic.

  • Closed Office

    Closed Office - 2012-10-30

    Edit: (the only way I can). I meant I've only done it with about 60 files at a time.