Search through files to find matching strings that do NOT contain a prefix

I have roughly 1000 files from a website on my local hard disk.  I want to determine if any of these files have:
http://localhost

Open in new window

on any line, except skip the ones that have:
comment="http://localhost

Open in new window


Thus, if there are any "HREF="http://localhost" entries, it would show up, or any "SRC="http://localhost", it would show up in the results.

Any easy way to do this?
Tim TitusCTOAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
grep http://localhost files | grep -v 'comment="http://localhost'
1
Bill PrewIT / Software Engineering ConsultantCommented:
What O/S ?


»bp
0
Tim TitusCTOAuthor Commented:
Sorry, Windows 10.  I don't have grep.
0
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

Bill PrewIT / Software Engineering ConsultantCommented:
Here's an approach with FINDSTR, you may want to tweak the options a bit, but see if this is close to what you are looking for.  Open a command prompt window, CD to the folder where the files are, and then do:

findstr /n/c:"http://localhost" < *.* | findstr /v /c:"comment=\"http://localhost"

Open in new window



»bp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tim TitusCTOAuthor Commented:
Perfect!  I didn't know findstr existed!  Thanks!
0
Bill PrewIT / Software Engineering ConsultantCommented:
Welcome, glad that helped.


»bp
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.