I have a log file what contains S.M.A.R.T. data of my hard drive. I would like to handle this file with PowerShell. Here is the part of my log file.
3 Spin_Up_Time 0x0020 100 100 000 Old_age Offline - 0
4 Start_Stop_Count 0x0030 100 100 000 Old_age Offline - 0
5 Reallocated_Sector_Ct 0x0032 100 100 000 Old_age Always - 0
And here is my code
$i = 1
$a = Get-Content log.txt
do {
$trimmed = $a[$i].trim()
$splitted = $trimmed.split(" ")
$i++
}while ($i -le 3)
If I use the .split(" ") it is working only with the thrid row. How can I split my all rows correctly?
Thank you