Visual Studio查找不包含X的文件 [英] Visual studio Find files that does NOT contain X

查看:222
本文介绍了Visual Studio查找不包含X的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种方式来列出不包含已知文本的所有文件。

该项目包含超过1000个文件,想要那些不包含一些文本的。



我想到正则表达式,但是它没有这样的功能。

任何人都知道解决方案?

解决方案

从命令提示符:
$ (FILE_SPECIFIER)中的b $ b

  @for / r%f做@findYOUR_STRING%f> nul || echo%f 

例如:

<$ p (* .cshtml)中的@f> C:\ web-trunk \视图> @for / r%f做@findLayout%f> nul || echo%f

C:\data\web-trunk\Views\Account\RegisterPartial.cshtml
C:\data\web-trunk\Views\\ \\Admin\SiteInspector.cshtml
C:\data\web-trunk\Views\CandidateProfile\View.cshtml
C:\data\web-trunk\Views\\ \\ Common \ContactFooterForInfoEmails.cshtml
C:\data\web-trunk\Views\Common\ContactFooterForInfoPages.cshtml
C:\data\web-trunk\Views\\ \\ Common \ContactFooterForSalesEmails.cshtml
C:\data\web-trunk\Views\Common\ContactFooterForSalesPages.cshtml


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 some text.

I thought of Regular expressions, but it doesn't have such a feature.

Anyone knows a solution?

解决方案

From a command prompt:

@for /r %f in (FILE_SPECIFIER) do @find "YOUR_STRING" "%f" > nul || echo %f

For example:

C:\web-trunk\Views>@for /r %f in (*.cshtml) do @find "Layout" "%f" > nul || echo %f

C:\data\web-trunk\Views\Account\RegisterPartial.cshtml
C:\data\web-trunk\Views\Admin\SiteInspector.cshtml
C:\data\web-trunk\Views\CandidateProfile\View.cshtml
C:\data\web-trunk\Views\Common\ContactFooterForInfoEmails.cshtml
C:\data\web-trunk\Views\Common\ContactFooterForInfoPages.cshtml
C:\data\web-trunk\Views\Common\ContactFooterForSalesEmails.cshtml
C:\data\web-trunk\Views\Common\ContactFooterForSalesPages.cshtml

这篇关于Visual Studio查找不包含X的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆