16 lines
792 B
Plaintext
16 lines
792 B
Plaintext
FileName = "Readings.txt"; data = Import[FileName,"TSV"];
|
|
Scan[(a=Position[#[[3;;All;;2]],1];
|
|
Print["Line:",#[[1]] ,"\tReject:", 24 - Length[a], "\t Accept:", Length[a], "\tLine_tot:",
|
|
Total@Part[#, Flatten[2*a]] , "\tLine_avg:", Total@Part[#, Flatten[2*a]]/Length[a]])&, data]
|
|
|
|
GlobalSum = Nb = Running = MaxRunRecorded = 0; MaxRunTime = {};
|
|
Scan[ For[i = 3, i < 50, i = i + 2,
|
|
If[#[[i]] == 1,
|
|
Running=0; GlobalSum += #[[i-1]]; Nb++;,
|
|
Running ++; If[MaxRunRecorded < Running, MaxRunRecorded = Running;MaxRunTime={ #[[1]]}; ];
|
|
]] &, data ]
|
|
|
|
Print["\nFile(s) : ",FileName,"\nTotal : ",AccountingForm@GlobalSum,"\nReadings : ",Nb,
|
|
"\nAverage : ",GlobalSum/Nb,"\n\nMaximum run(s) of ",MaxRunRecorded,
|
|
" consecutive false readings ends at line starting with date(s):",MaxRunTime]
|