I have a text file that I need to go through line by line and delete any text that is in quotation marks and does not match one of the following values:
- 192.168.10.1
- 192.168.11.1
- 192.168.12.1
- 192.168.13.1
My initial file would look something like this:
IPADDRESS "192.168.10.1" "192.168.11.1" "192.168.12.1" "192.168.13.1" "10.0.0.1"
IPADDRESS "192.168.10.1" "192.168.11.1" "127.0.0.1" "192.168.12.1" "192.168.13.1"
and I would like my output to be similar to the following:
IPADDRESS "192.168.10.1" "192.168.11.1" "192.168.12.1" "192.168.13.1"
IPADDRESS "192.168.10.1" "192.168.11.1" "192.168.12.1" "192.168.13.1"
I've experimented with using the -replace option, regular expressions, using the trim option, using a filter, using the -match option, to varying degrees of success, but I keep hitting a brick wall...