Get input file, export CSV file without the rows from the input file

This post was originally published on this site

Hi LucD


I am trying to filter a VRNI CSV file and I need some help to exclude IP address which i have in an input.csv file

Once it excludes then i need to create a new CSV with only the excluded data


Here is my Input.CSV file





Here is my output.csv file


desip ALLOW Protocol SourceIP
192,168,1,10 ALLOW TCP 10,10,10,1
192,168,1,11 ALLOW TCP 10,10,10,2
192,168,1,12 ALLOW TCP 10,10,10,3
192,168,1,13 ALLOW TCP 10,10,10,4
192,168,1,14 ALLOW TCP 10,10,10,5 ALLOW UDP 10,10,10,6 ALLOW TCP 10,10,10,7 ALLOW TCP 10,10,10,8 ALLOW TCP 10,10,10,9 ALLOW TCP 10,10,10,10 ALLOW TCP 10,10,10,11 ALLOW TCP 10,10,10,12 ALLOW TCP 10,10,10,13 ALLOW TCP 10,10,10,14 ALLOW TCP 10,10,10,15 ALLOW TCP 10,10,10,16 ALLOW UDP 10,10,10,17 ALLOW UDP 10,10,10,18 ALLOW UDP 10,10,10,19



I need to read the Input CSV and if the IP address on the Input CSV matches the output.CSV then i need to exclude that line  and i need to export a new CSV file with the excluded CSV file

Because i dont need any ip address from the input file on the new CSV file because it garbage data


When i execute this code i get all the entries and its not excluding the data found from the input file

Can you help me with this please



$inputfile=import-csv -Path “C:tempinput.csv”

$outputfile = import-csv -Path “C:TempVRNIOutputfile.CSV”


$outputfile |where {$inputfile.ipaddress -notin $_.desip}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.