#!bin/perl

do "parameters.pl";

# Open the file for reading.
open DATA1, "Uloop_dp.csv" or die "can't open file $!";
my @data1 = <DATA1>;
close (DATA1);

$TotalMagneticFlux=0;
for ($i=0;$i<$LineCount;++$i)
{
	@row1=split(';',$data1[$i]);
	$TotalMagneticFlux= $row1[1] <= 0 ? $TotalMagneticFlux : $TotalMagneticFlux + $row1[1]*0.00001; #[V*s]
}
$TotalMagneticFlux=sprintf("%.3f",$TotalMagneticFlux);
open CIL1, ">TotalMagneticFlux";
print CIL1 "$TotalMagneticFlux";
close (CIL1);
