1

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)

1 Answer 1

2

You can cast the value to int:

$intValue = [int]$testNum[1]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.