Text processing/1: Difference between revisions

Content added Content deleted
(Add mirror of data file. (Link is 404))
(→‎{{header|Kotlin}}: Re-ran program following recovery and mirroring of full data file.)
Line 2,201: Line 2,201:


=={{header|Kotlin}}==
=={{header|Kotlin}}==
<lang scala>// version 1.2.31
As the link to the full data file is now broken, I've had to confine myself to the 6 lines shown in the task description for testing purposes.
<lang scala>// version 1.2.0


import java.io.File
import java.io.File
Line 2,255: Line 2,254:


{{out}}
{{out}}
Abbreviated output:
<pre>
<pre>
Line: 1991-03-30 Reject: 0 Accept: 24 Line_tot: 240.000 Line_avg: 10.000
Line: 1990-01-01 Reject: 2 Accept: 22 Line_tot: 590.000 Line_avg: 26.818
Line: 1991-03-31 Reject: 0 Accept: 24 Line_tot: 565.000 Line_avg: 23.542
Line: 1990-01-02 Reject: 0 Accept: 24 Line_tot: 410.000 Line_avg: 17.083
Line: 1991-03-31 Reject: 23 Accept: 1 Line_tot: 40.000 Line_avg: 40.000
Line: 1990-01-03 Reject: 0 Accept: 24 Line_tot: 1415.000 Line_avg: 58.958
Line: 1991-04-01 Reject: 1 Accept: 23 Line_tot: 534.000 Line_avg: 23.217
Line: 1990-01-04 Reject: 0 Accept: 24 Line_tot: 1800.000 Line_avg: 75.000
Line: 1991-04-02 Reject: 0 Accept: 24 Line_tot: 475.000 Line_avg: 19.792
Line: 1990-01-05 Reject: 0 Accept: 24 Line_tot: 1130.000 Line_avg: 47.083
....
Line: 1991-04-03 Reject: 0 Accept: 24 Line_tot: 335.000 Line_avg: 13.958
Line: 2004-12-27 Reject: 1 Accept: 23 Line_tot: 57.100 Line_avg: 2.483
Line: 2004-12-28 Reject: 1 Accept: 23 Line_tot: 77.800 Line_avg: 3.383
Line: 2004-12-29 Reject: 1 Accept: 23 Line_tot: 56.300 Line_avg: 2.448
Line: 2004-12-30 Reject: 1 Accept: 23 Line_tot: 65.300 Line_avg: 2.839
Line: 2004-12-31 Reject: 1 Accept: 23 Line_tot: 47.300 Line_avg: 2.057


File = readings.txt
File = readings.txt
Total = 2189.000
Total = 1358393.400
Readings = 120
Readings = 129403
Average = 18.242
Average = 10.497


Maximum run of 24 consecutive false readings
Maximum run of 589 consecutive false readings
ends at line starting with date: 1991-04-01
ends at line starting with date: 1993-03-05
</pre>
</pre>