Findstr help

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
rfpd
Posts: 78
Joined: 06 Jul 2009 16:19
Location: Lisbon, Portugal
Contact:

Findstr help

#1 Post by rfpd » 29 Jul 2009 03:56

How I do a findstr who can find and if he find something he delete the results?

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 29 Jul 2009 11:53

First -- what? I don't think I understand what you're asking.

But, maybe this:

(using findstr syntax from memory)
findstr /c:"your text to search for" c:\yourfile.txt
if not errorlevel 1 del c:\yourfile.txt

rfpd
Posts: 78
Joined: 06 Jul 2009 16:19
Location: Lisbon, Portugal
Contact:

Thanks

#3 Post by rfpd » 30 Jul 2009 11:05

thanks men it works but the code is not correct the first line so i make changes:

Code: Select all

findstr ola c:\yourfile.txt
if not errorlevel 1 del c:\yourfile.txt

rfpd
Posts: 78
Joined: 06 Jul 2009 16:19
Location: Lisbon, Portugal
Contact:

Sorry

#4 Post by rfpd » 30 Jul 2009 11:21

Sorry my english i am portuguese and i am 13 years old i am learning more about english thanks you are great!

Post Reply