i’d like to parse this file:
Case Given Predicted
No Class Class
1 ? 0 [0.80]
2 ? 0 [0.80]
3 ? 0 [0.80]
4 ? 1 [0.75]
5 ? 0 [0.80]
6 ? 0 [0.80]
7 ? 1 [0.75]
8 ? 0 [0.80]
9 ? 0 [0.80]
10 ? 0 [0.80]
11 ? 1 [0.75]
12 ? 0 [0.80]
13 ? 0 [0.80]
14 ? 0 [0.80]
15 ? 0 [0.80]
16 ? 0 [0.80]
17 ? 0 [0.80]
18 ? 0 [0.80]
19 ? 0 [0.80]
20 ? 0 [0.80]
Especially, i want to take values from third column (“Predicted class”).I open file thanks to:
$txt_file = file_get_contents('simone.result');
$array = explode("\n", $txt_file);
array_shift($array);
array_shift($array);
array_shift($array);
And I have this:
Array ( [0] => 1 ? 0 [0.80] [1] => 2 ? 0 [0.80]
Ok this is correct. But I want only the third value (“0” or “1”) in each key of this array. Does anyone can help me please?
Thank you so much!
1 Answer