I am trying to sort a colomn with numbers in a CSV file. But somehow it doesn't work. Sample CSV:
Orange;65
Red;160
Green;140
White;110
Purple;85
This is the piece of code I tried it with:
$csv = Import-Csv -Header "Color", "Number" -delimiter ';' data.csv
$csv | Sort-Object Number
Which gives me the following output:
Color Number
----- ------
White 110
Green 140
Red 160
Orange 65
Purple 85
Obviously not in the correct order. Can someone please explain me how to resolve this issue?