This is the table:
I use import-CSV to get the data from the table:
$Process = @()
$Energy = @()
Import-Csv C:\Users\Shuai\Desktop\test\Test.csv |`
ForEach-Object
{
$Process += $_."Process"
$Energy += $_.Energy
}
$inputName = Read-Host -Prompt "Process"
if ($Process -contains $inputName)
{
$Where = [array]::IndexOf($Process, $inputName)
$Energy[$Where]
}
If I type Construction it will give me 0.1 as the value of Energy. But it cannot be used to do any calculation.
For an example, if I use
$xx = $Energy[$Where]
$XY = $xx * 5
What I got is 0.10.10.10.10.10.1. I don not want to just repeat the value for five times. I need 0.5 for the result.
Is there any method to use this value as the normal variable (for normal calculations)?
