34 lines
891 B
PHP
Executable File
34 lines
891 B
PHP
Executable File
<?php
|
|
define("ARQUIVOTREINO","notastreino.csv");
|
|
define("ARQUIVOPREDITAS","notastestepreditas.csv");
|
|
|
|
function tail($h_size,$arr) {
|
|
$ta=count($arr);
|
|
for($i=$h_size;$i<$ta;$i++) {
|
|
|
|
}
|
|
}
|
|
|
|
$pastas_arquivospredicao = scandir("./arquivospredicao");
|
|
$exercicios = tail(2,$pastas_arquivospredicao);
|
|
$saida = fopen("./comparanotas.csv","w");
|
|
$tam= count($exercicios);
|
|
for($i=0;$i<$tam;$i++) {
|
|
$p_file = file($exercicios[$i] . ARQUIVOPREDITAS);
|
|
$t_file = file($exercicios[$i] . ARQUIVOPREDITAS);
|
|
for($j=0;$j<count($p_file);$i++) {
|
|
$p_line = $p_file[$j];
|
|
$t_line = $t_file[$j];
|
|
list($p_code,$p_nota) = explode(";",$p_line);
|
|
list($t_code,$t_nota) = explode(",",$t_line);
|
|
if($p_code == $t_code) {
|
|
$saida_line = $p_code . ';' . $t_nota . ';' . $p_nota . ';' . ($p_nota - $t_nota);
|
|
fwrite($saida,$saida_line . "\n");
|
|
}
|
|
}
|
|
unset($p_file);
|
|
unset($t_file);
|
|
}
|
|
fclose($saida);
|
|
?>
|