Computer Hope

Microsoft => Microsoft DOS => Topic started by: Lemonilla on July 02, 2012, 12:50:03 PM

Title: | find /v
Post by: Lemonilla on July 02, 2012, 12:50:03 PM
Is there a way to remove extra (blank) lines? So like
Code: [Select]
ping www.yahoo.com |find /v "Pinging" | find /v "Reply" | find /v "Ping" | find /v "Packets" | find /v "Approximate"but without all the extra blank lines, so I can write it to a file and retreve it later?

EDIT:
still haven't found the delete button yet, but this was solved with:
Code: [Select]
ping www.yahoo.com |find "Min"
Title: Re: | find /v
Post by: Squashman on July 02, 2012, 01:33:04 PM
You sure over thought that one.   ;D
Title: Re: | find /v
Post by: Salmon Trout on July 03, 2012, 01:08:52 PM
I quite like all those pipes...
Title: Re: | find /v
Post by: Helpmeh on July 04, 2012, 10:48:41 AM
For loops automatically skip over any blank lines, so try something like this:
Code: [Select]
for /f "delims=" %%a in ('ping www.computerhope.com') do echo %%a >> output.txt
Title: Re: | find /v
Post by: Squashman on July 04, 2012, 02:58:59 PM
For loops automatically skip over any blank lines, so try something like this:
Code: [Select]
for /f "delims=" %%a in ('ping www.computerhope.com') do echo %%a >> output.txt
That really has nothing to do with his problem.  He is just looking for the output of one line from the PING command.
Code: [Select]
Minimum = 66ms, Maximum = 161ms, Average = 126ms