Panikosagros
Panikosagros

Reputation: 107

Batch file to search in txt and remove unwanted lines

I need a batch file to search in the print route:

Network Destination        Netmask          Gateway       Interface  Metric

      0.0.0.0          0.0.0.0       10.0.0.254        10.0.0.31    276
      0.0.0.0          0.0.0.0       10.10.10.1     10.10.10.134     25
     10.0.0.0        255.0.0.0       10.0.0.254        10.0.0.31     21
     10.0.0.0    255.255.255.0         On-link         10.0.0.31    276
    10.0.0.31  255.255.255.255         On-link         10.0.0.31    276

And return everything except the the "on-link" lines.

Upvotes: 1

Views: 104

Answers (1)

rojo
rojo

Reputation: 24466

You don't need a script for this. This is a one liner.

route print -4 | find /v /i "on-link"

Upvotes: 3

Related Questions