Skip to main content
Okoth1
Inspiring
September 20, 2022
Answered

Find html files that don't contain certain string

  • September 20, 2022
  • 3 replies
  • 388 views

I'm looking for a way to go through a folder with HTML files and list the files that are missing a certain string. Is there a way to do this with Dreamweaver 21.2 in Windows 10?

 

Thanks

 

 

 

    This topic has been closed for replies.
    Correct answer Okoth1

    I went ahead and found a solution Visual Studio Code. There is an extension called "Reverse Search". Got the list.

    Thanks for your replies anyway.

    3 replies

    Okoth1
    Okoth1AuthorCorrect answer
    Inspiring
    September 20, 2022

    I went ahead and found a solution Visual Studio Code. There is an extension called "Reverse Search". Got the list.

    Thanks for your replies anyway.

    Nancy OShea
    Community Expert
    Community Expert
    September 20, 2022

    I'm RegEx challenged.  Whenever possible, I use Advanced Find & Replace with tags and attributes.   Will that work for you?

     

     

     

    Nancy O'Shea— Product User & Community Expert
    Okoth1
    Okoth1Author
    Inspiring
    September 20, 2022

    I'm all in for it, but how can I find the files that don't contain a string using the Advanced Find?

    When I use in Advanced: Not Containing --> Text --> script src, as a result, I get every line that is in those 397 documents. Including the script lines.

    Jon Fritz
    Community Expert
    Community Expert
    September 20, 2022

    Depending on what you're looking for a Regular Expression like the following may work...

    ^((?!the specific text here).)*$

    1. Open the Find & Replace in Files window (Ctrl + Shift + F)
    2. Click the Basic tab
    3. Click the martini glass icon (Filter)
    4. Check Use Regular Expression
    5. In the Find In field, paste...
         ^((?!the specific text here).)*$
    ...and replace the bold part with the text you want to exclude
    6. Make sure "Entire Current Local Site" is selected for the "In" field and leave [any tag] selected

    7. Click Find All
    8. In the Search Window that comes up, you will get a list of pages that don't include your text, double click them to open them from the list

    [Moderator Note: Color added for clarity]

    Okoth1
    Okoth1Author
    Inspiring
    September 20, 2022

    If I do exactly what you say and use the regular expression ^((?!<script src).)*$ I get Not Found in 397 documents.
    I assume the question and exclamation marks are not bold (hard to see on my screen).

    Jon Fritz
    Community Expert
    Community Expert
    September 21, 2022

    The search you give works perfectly here, same version of DW, same OS.

    Did you check the box for Use Regular Expression (step 3-4 above)?

    Without that checkmark in place, the search string doesn't run.