Visual studio Find files that does NOT contain X

前端 未结 4 1834
一向
一向 2021-02-13 14:42

I need a way to list all files that does NOT contain a known text.

The project contains over 1000 files and I only want the ones that does not contain s

4条回答
  •  清歌不尽
    2021-02-13 15:44

    UPDATE: as Peter McVoy pointed out, this solution does not work. It will return false positives (files that contain a line without the text to search for will also be printed). A VS macro or a custom powershell script is probably the way to go. I might revisit this answer later.

    For reference, this was my answer:

    You can do this on the command line:

    findstr /S /V /M text_to_search_for *.cs
    

    This will print all filenames that do not contain the text

提交回复
热议问题