So I have got a file which contains lines like this :
Peter Nagy 3 4 6 7 4
I need a Power shell script which asks the user to give a name, and it maths out the avarage of thoose numbers next to that name. Please help 🙂
$name1 = read-host
$content = Get-Content test.txt
$talalt = $content | Where-Object { $_ -match $name1 }
I have no idea what to do after this, and how to get out of thoose numbers from that string.
Thanks in advance
You basically need to select from the first digit to the end of the line, split out the individual numbers and then average them e.g.: