Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Sorting issue in import-csv

$
0
0

 

I have CSV file contains below data. I am not able to sort the numeric data (with couple of string included) as desired. 

 

Percentage

99.91

100

99.96

NoObjects

100

100

99.94

99.61

 

When I use the below commands, I am not able to get the Percentage column sorted in proper ascending/descending order.

 

$summarydata = Import-Csv summary.csv | Sort-Object {[int]$_.PercCompliance}

 

Currently above script, gives output as below.

 

 

I am aware about CSV file, will take string value. Is there any easy method to sort below sample data ?


Viewing all articles
Browse latest Browse all 6937

Trending Articles