How to list all files that does not contain a pattern (i.e. string) ?

How to list all files that does not contain a pattern?

LIST all csproj files that does not contain certain string (i.e. BUILD_TSM_VERSION)

@for /r %f in (*.csproj) do @find "BUILD_TSM_VERSION" "%f" > nul   || echo %f
@for /r %f in (*.csproj) do @find "IntermediateOutputPath" "%f" > nul || echo %f

Find all occurences of Package but not Package$

findstr /s /n /r "\<Package[^$]\>" *.vcxproj *.csproj *.cmd *.bat

Also, do read

http://stackoverflow.com/questions/406230/regular-expression-to-match-string-not-containing-a-word

How to list all files that contains a pattern string

You can list all csproj files that contaians TSMVERSION using command:

findstr /m /s /c:"TSMVERSION" *.csproj
Advertisements
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s