Link to home
Start Free TrialLog in
Avatar of Tim Titus
Tim TitusFlag for United States of America

asked on

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?
Avatar of ozo
ozo
Flag of United States of America image

grep http://localhost files | grep -v 'comment="http://localhost'
Avatar of Bill Prew
Bill Prew

What O/S ?


»bp
Avatar of Tim Titus

ASKER

Sorry, Windows 10.  I don't have grep.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Perfect!  I didn't know findstr existed!  Thanks!
Welcome, glad that helped.


»bp