Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

qgrep , then do something with it

Status
Not open for further replies.

tjbradford

Technical User
Dec 14, 2007
229
GB
OK OK I know it says qgrep which means windows however i think you people reading this are going to be of more help than them windows people,

i want to qgrep a file for example then do something with it like delete it.

if i dir |qgrep -i .ini |qgrep -v Jan

it will give a file , i then want to delete it.

so i'm after using the output and sticking a delete infront of it. any ideas?
 
Your command doesn't create any file, so what is your problem ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi

I think the OP means that command outputs the name of the file he wish to delete. That would mean the question is not about [tt]qgrep[/tt] but how to do [tt]rm [red]`[/red]qgrep ...[red]`[/red][/tt] in [tt]cmd[/tt].

Feherke.
 
FOR /F "usebackq delims==" %i IN (`dir |qgrep -i .ini |qgrep -v Jan`) DO @del /P %i

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top