I need help to parse an input like this.
192.168.0.168: 1
192.168.0.158: 0
192.168.0.198: 0
192.168.0.148: 0
192.168.0.158: 1
192.168.0.168: 0
If there is 1 in second column of any ip, I want to delete the row which have 0 in second column and same ip in first column. So my output should be like this.
192.168.0.168: 1
192.168.0.198: 0
192.168.0.148: 0
192.168.0.158: 1
I guess It can be done by using awk, sed etc. but I have no idea how to do that. I hope I could explain my question correctly. Thanks...