Text processing/1: Difference between revisions

Content added Content deleted
m (→‎{{header|Phix}}: no_empty now defaults to true)
(Updated to work with Nim 1.4: replaced [1..-1]" with "[1..^1]. Changed output formatting to use the more friendly "strformat". Done miscellaneous other changes.)
Line 2,496: Line 2,496:
echo "Maximum run(s) of ", nodataMax, " consecutive false readings ends at line starting with date(s): ", nodataMaxLine.join(" ")</lang>
echo "Maximum run(s) of ", nodataMax, " consecutive false readings ends at line starting with date(s): ", nodataMaxLine.join(" ")</lang>
Output:
Output:
<pre>$ ./textproc1 readings.txt|tail
<pre>$ ./textproc1 readings.txt | tail
Line: 2004-12-29 Reject: 1 Accept: 23 LineTot: 56.3 LineAvg: 2.44783
Line: 2004-12-29 Reject: 1 Accept: 23 LineTot: 56.30 LineAvg: 2.45
Line: 2004-12-30 Reject: 1 Accept: 23 LineTot: 65.3 LineAvg: 2.83913
Line: 2004-12-30 Reject: 1 Accept: 23 LineTot: 65.30 LineAvg: 2.84
Line: 2004-12-31 Reject: 1 Accept: 23 LineTot: 47.3 LineAvg: 2.05652
Line: 2004-12-31 Reject: 1 Accept: 23 LineTot: 47.30 LineAvg: 2.06


File(s) = readings.txt
File(s) = readings.txt
Total = 1.35839e+06
Total = 1358393.40
Readings = 129403
Readings = 129403
Average = 10.4974
Average = 10.50


Maximum run(s) of 589 consecutive false readings ends at line starting with date(s): 1993-03-05</pre>
Maximum run(s) of 589 consecutive false readings ends at line starting with date(s): 1993-03-05.</pre>


=={{header|OCaml}}==
=={{header|OCaml}}==