Empty value powershell array -


i have strange issue, csv:

serveur;carte;cordon;ip;mac;vmnic ;vmnic mac;connect;port dexter;eth1;405;172.16.5.117;00:24:e8:36:36:df;vmnic0;00:50:56:56:36:df;sw-front-1;a1 dexter;eth2;14;192.168.140.17;00:24:e8:36:36:e1;vmnic1;00:50:56:56:36:e1; sw_eq_ds_1;3 ;;;;;;;; gordon;eth1;404;172.16.5.124;b8:ac:6f:8d:ac:b4;vmnic0;00:50:56:5d:ac:b4;; gordon;eth2;35;192.168.140.114;b8:ac:6f:8d:ac:b6;vmnic1;00:50:56:5d:ac:b6;; gordon;eth3;254;192.168.33.10;b8:ac:6f:8d:ac:b8;vmnic2;00:50:56:5d:ac:b8;; 

so imported array following code:

$serveur = @()  import-csv c:\users\aasif\desktop\myfile.csv -delimiter ";" |`     foreach-object {         $serveur += $_.serveur     } 

and remove duplicate values did :

$serveur = $serveur | sort -uniq 

so when display array, obtain these 2 values : dexter , gordon , third null value

but empty value

the following code return 3

$serveur.count 

why?

thanks help

if want exclude empty values can this

$serveur = $serveur |  ? { $_ } | sort -uniq 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -