I have a CSV file that I need to remove rows, here is my example
"Name","Local_IP","Remote_IP"
"Sep 1 03:55:57 pc-00017 SymantecServer mserver-4: mmt-5","172.16.48.158","22.22.22.22"
"Sep 1 03:55:57 pc-00017 SymantecServer mserver-4: mmt-5","172.16.48.158","22.22.22.22"
"Sep 1 03:55:57 pc-00017 last message repeated 3 times","","
"Sep 1 03:55:57 pc-00017 SymantecServer mserver-4: mmt-5","172.16.48.158","22.22.22.22"
"Sep 1 03:55:57 pc-00017 last message repeated 2 times","","
"Sep 1 03:55:57 pc-00017 SymantecServer mserver-4: mmt-5","172.16.48.158","22.22.22.22"
I need to remove the row that has the "last message repeated" removed.
I have tried with no luck.
$test = import-csv myfile.csv | where {$_.Name -notcontains "repeated"}
$test | export-csv myfile.csv -notype
Any help plese?