Reputation: 3083
I have a csv file that looks like this
"NumberofNullAsOfDates"
"0"
I would like to check if there is a 0 or any other value there. This is currently the powershell code I have but it doesn't seem to work out so well.
$testNum = @()
$testNum += Import-Csv craneAudit.csv
$testNum[1]
How could I make this work so that $testNum only contains "0" (without quotes)
Upvotes: 1
Views: 319
Reputation: 43559
You can cast the value to int:
$intValue = [int]$testNum[1]
Upvotes: 2