Text processing/Max licenses in use: Difference between revisions

Scala contribution added.
(Added Julia language)
(Scala contribution added.)
Line 1:
{{task|Text processing}}
 
A company currently pays a fixed sum for the use of a particular licensed software package.   In determining if it has a good deal it decides to calculate its maximum use of the software from its license management log file.
 
Assume the software's licensing daemon faithfully records a checkout event when a copy of the software starts and a checkin event when the software finishes to its log file.
Line 12:
 
;Task:
Save the 10,000 line log file from &nbsp; [http://rosettacode.org/resources/mlijobs.txt <big> here</big>] &nbsp; into a local file, then write a program to scan the file extracting both the maximum licenses that were out at any time, and the time(s) at which this occurs.
 
Mirror of log file available as a zip [https://github.com/thundergnat/rc/blob/master/resouces/mlijobs.zip here] (offsite mirror).
<br><br>
 
=={{header|Ada}}==
<lang Ada>-- licenselist.adb --
Line 89 ⟶ 88:
end licenselist;</lang>
Output:
The max. number of licenses out is 99
<pre>
The max. number of licenses out is 99
at these times
2008/10/03_08:39:34
2008/10/03_08:40:40
[2010-06-06 01:06:07] process terminated successfully (elapsed time: 00.25s)
 
</pre>
=={{header|ALGOL 68}}==
{{trans|C}} note: This specimen retains the original [http://rosettacode.org/mw/index.php?title=Text_processing%2F3&diff=87014&oldid=87011 C] coding style.
Line 174 ⟶ 172:
)</lang>
Output:
Maximum simultaneous license use is 99 at the following times:
<pre>
2008/10/03_08:39:34
Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:3940:3440
2008/10/03_08:40:40
</pre>
 
=={{header|APL}}==
Line 188 ⟶ 184:
mx ← (⎕IO+⍳⍴lu)/⍨lu= max ← ⌈/ lu
⎕ ← 'Maximum simultaneous license use is ' , ' at the following times:' ,⍨ ⍕max ⋄ ⎕←D[mx;]</lang>
<lang apl> Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34
2008/10/03_08:40:40</lang>
 
=={{Header|AutoHotkey}}==
{{trans|Python}}
<lang autohotkey>IfNotExist, mlijobs.txt
IfNotExist, mlijobs.txt
UrlDownloadToFile, http://rosettacode.org/mlijobs.txt, mlijobs.txt
 
Line 215 ⟶ 210:
}
 
MsgBox Maximum use is %max_out% at:`n`n%max_times%</lang>
Maximum use is 99 at:
</lang>
<pre>
Maximum use is 99 at:
 
2008/10/03_08:39:34
2008/10/03_08:40:40
</pre>
 
=={{header|AWK}}==
Line 242 ⟶ 234:
 
'''Sample output'''
<pre> The biggest number of licenses is 99 at 2008/10/03_08:39:34 and 2008/10/03_08:40:40 !</pre>
 
On a 2.53MHz machine, these timings were obtained using GNU Awk 4.0.2:
Line 278 ⟶ 270:
END</lang>
'''Output:'''
Maximum licences checked out = 99
<pre>
From 2008/10/03_08:39:34 to 2008/10/03_08:40:40
Maximum licences checked out = 99
From 2008/10/03_08:39:34 to 2008/10/03_08:40:40
</pre>
 
=={{header|Bracmat}}==
 
<lang bracmat>( 0:?N:?n
& :?Ts
Line 303 ⟶ 292:
)
| out$(!N !Ts)
);</lang>
</lang>
Output:
<pre> 99 2008/10/03_08:39:34 2008/10/03_08:40:40</pre>
 
=={{header|C}}==
 
<lang c>#include <stdio.h>
#include <stdlib.h>
Line 410 ⟶ 397:
munmap(buf, s.st_size);
return close(fd);
}</lang>output<lang>2008/10/03_08:39:34 99
2008/10/03_08:4039:4034 99</lang>
2008/10/03_08:40:40 99
 
=={{header|C++}}==
Line 470 ⟶ 458:
 
=={{header|C sharp|C#}}==
<lang csharp>using System;
using System;
using System.Collections.Generic;
using System.Linq;
Line 516 ⟶ 503:
}
}
}</lang>
}
99
</lang>
2008/10/03_08:39:34
<pre>
2008/10/03_08:40:40
99
2008/10/03_08:39:34
2008/10/03_08:40:40
</pre>
 
=={{header|Clojure}}==
 
<lang clojure>(defn delta [entry]
(case (second (re-find #"\ (.*)\ @" entry))
Line 543 ⟶ 526:
(map println times))</lang>
 
Maximum simultaneous license use is 99 at the following times:
<pre>
2008/10/03_08:39:34
Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:3940:3440
2008/10/03_08:40:40
</pre>
 
=={{header|COBOL}}==
Line 643 ⟶ 624:
 
=={{header|Common Lisp}}==
 
{{libheader|CL-PPCRE}}
 
<lang lisp>(defun max-licenses (&optional (logfile "mlijobs.txt"))
(with-open-file (log logfile :direction :input)
Line 665 ⟶ 644:
(push time max-log-times)))))))</lang>
 
<pre> > (max-licenses)
Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34
2008/10/03_08:40:40.
NIL</pre>
 
=={{header|D}}==
<lang d>void main() {
Line 691 ⟶ 669:
}</lang>
{{out}}
<pre> Maximum simultaneous license use is 99 at the following times:
"2008/10/03_08:39:34"
"2008/10/03_08:40:40"</pre>
 
=={{header|E}}==
 
{{trans|Python}}
 
<lang e>var out := 0
var maxOut := 0
Line 723 ⟶ 699:
}</lang>
=={{header|Eiffel}}==
<lang Eiffel>class
class
APPLICATION
 
Line 776 ⟶ 751:
data: LIST [STRING]
 
end</lang>
</lang>
{{out}}
Max Licences OUT: 99
<pre>
Date: 2008/10/03_08:39:34
Max Licences OUT: 99
Date: 2008/10/03_08:39:34
</pre>
 
=={{header|Erlang}}==
<lang Erlang>-module( text_processing_max_licenses ).
-module( text_processing_max_licenses ).
 
-export( [out_dates_from_file/1, task/0] ).
Line 813 ⟶ 784:
 
out_dates_n( N, <<"OUT">> ) -> N + 1;
out_dates_n( N, <<"IN">> ) -> N - 1.</lang>
</lang>
{{out}}
12> text_processing_max_licenses:task().
<pre>
Max licenses was 99 at [<<"2008/10/03_08:39:34">>,<<"2008/10/03_08:40:40">>]
12> text_processing_max_licenses:task().
Max licenses was 99 at [<<"2008/10/03_08:39:34">>,<<"2008/10/03_08:40:40">>]
</pre>
 
=={{header|Euphoria}}==
Line 877 ⟶ 845:
printf(1, "%s\n", {maxtime[i]})
end for</lang>
 
Output:
<pre> Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34
2008/10/03_08:40:40
</pre>
 
=={{header|Factor}}==
Placing the file in resource:work/mlijobs.txt:
 
<lang factor>USING: kernel sequences splitting math accessors io.encodings.ascii
io.files math.parser io ;
Line 946 ⟶ 911:
 
=={{header|Forth}}==
<lang forth>20 constant date-size
20 constant date-size
create max-dates date-size 100 * allot
variable max-out
Line 979 ⟶ 943:
max-dates count type cr ;
 
main bye</lang>
</lang>
 
== {{header|Fortran}} ==
{{Works with|Fortran|90 and later}}
 
<lang fortran> PROGRAM MAX_LICENSES
PROGRAM MAX_LICENSES
IMPLICIT NONE
Line 1,022 ⟶ 984:
WRITE(*,"(A)") maxtime(1:maxcount)
END PROGRAM MAX_LICENSES</lang>
</lang>
Output
<pre>
Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34
2008/10/03_08:40:40
 
</pre>
=={{header|Gema}}==
Start with ''gema -f licenses.gema mlijobs.txt''
<lang gema>@set{count;0};@set{max;0}
@set{count;0};@set{max;0}
 
License OUT \@ * *\n=@incr{count}@testmax{${count},*}
Line 1,041 ⟶ 1,000:
testmax:*,*=@cmpn{${max};$1;@set{max;$1};;}@append{times${count};$2\n}
 
report:*,*=Maximum simultaneous license use is * at\n*</lang>
</lang>
Output:
Maximum simultaneous license use is 99 at
<pre>
2008/10/03_08:39:34
Maximum simultaneous license use is 99 at
2008/10/03_08:3940:3440
2008/10/03_08:40:40
</pre>
 
=={{header|Go}}==
Line 1,112 ⟶ 1,068:
}</lang>
{{out}}
max licenses: 99
<pre>
at:
max licenses: 99
at:
2008/10/03_08:39:34
2008/10/03_08:40:40
</pre>
 
=={{header|Groovy}}==
Line 1,148 ⟶ 1,102:
 
println "Maximum Licenses $max"
dates.each { date -> println " $date" }</lang>
</lang>
Output:
Maximum Licenses 99
<pre>
Maximum Licenses 99
2008/10/03_08:39:34
2008/10/03_08:40:40
</pre>
 
== {{header|Haskell}} ==
<lang haskell>import Data.List
import Data.List
 
main = do
Line 1,167 ⟶ 1,117:
mo = maximum cio
putStrLn $ "Maximum simultaneous license use is " ++ show mo ++ " at:"
mapM_ (putStrLn . (dt!!)) . elemIndices mo $ cio</lang>
</lang>
 
=={{header|HicEst}}==
{{incorrect|HicEst}}
We open Licenses.txt in [http://www.HicEst.com/MatrixExplorer.htm MatrixExplorer mode] with 3 columns: IN/OUT, date_time, ID_nr.
This allows to adress single file elements by Licenses(row, column).
Line 1,221 ⟶ 1,171:
 
And a run of the program:
<pre> ->ml <mlijobs.txt
There were 99 licenses out at:
2008/10/03_08:39:34
2008/10/03_08:40:40
-></pre>
 
 
== {{header|J}} ==
Line 1,236 ⟶ 1,185:
NB. Output results
(mx { D) ,~ 'Maximum simultaneous license use is ' , ' at the following times:' ,~ ": {. ,mx { lu</lang>
<pre>
Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34
2008/10/03_08:40:40
</pre>
 
=={{header|Java}}==
Line 1,274 ⟶ 1,221:
}
}</lang>
<pre> Max licenses out: 99
At time(s): [2008/10/03_08:39:34, 2008/10/03_08:40:40]</pre>
 
=={{header|JavaScript}}==
Line 1,303 ⟶ 1,250:
 
output:
<pre> Max licenses out: 99
2008/10/03_08:39:34
2008/10/03_08:40:40</pre>
=={{header|jq}}==
{{works with|jq|1.4}}
Line 1,344 ⟶ 1,291:
`0:,/"Maximum simultaneous license use is ",$x;
`0:" at the following times:\n";`0:r[;14+!19]</lang>
 
Output:
Maximum simultaneous license use is 99 at the following times:
 
2008/10/03_08:39:34
<lang K>Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:3940:3440
2008/10/03_08:40:40</lang>
 
=={{header|Julia}}==
{{works with|Julia|0.6}}
{{trans|Python}}
 
<lang julia>function maximumsimultlicenses(io::IO)
out, maxout, maxtimes = 0, -1, String[]
Line 1,373 ⟶ 1,317:
println("Maximum simultaneous license use is $maxout at the following times: \n - ", join(maxtimes, "\n - "))
end</lang>
 
{{out}}
<pre> Maximum simultaneous license use is 99 at the following times:
- 2008/10/03_08:39:34
- 2008/10/03_08:40:40</pre>
 
=={{header|Kotlin}}==
Line 1,411 ⟶ 1,354:
println(dates.map { " $it" }.joinToString("\n"))
}</lang>
 
The file used for testing:
<pre>License OUT @ 2008/10/03_23:51:05 for job 4974
<pre>
License OUT @ 2008/10/03_23:51:05 for job 4974
License OUT @ 2008/10/03_23:57:00 for job 4975
License IN @ 2008/10/04_00:00:06 for job 4975
License OUT @ 2008/10/04_00:07:19 for job 4976
License IN @ 2008/10/04_00:11:32 for job 4976
License IN @ 2008/10/04_00:18:22 for job 4974</pre>
</pre>
 
{{out}}
Maximum simultaneous license use is 2 at the following time(s):
<pre>
Maximum simultaneous license use is 2 at the following time(s):
2008/10/03_23:57:00
2008/10/04_00:07:19
</pre>
 
=={{header|Lua}}==
Line 1,461 ⟶ 1,398:
end</lang>
Output:
<pre> Maximum licenses in use: 99
Occurrences:
2008/10/03_08:39:34
2008/10/03_08:40:40</pre>
 
=={{header|M4}}==
<lang M4>divert(-1)
divert(-1)
define(`current',0)
define(`max',0)
Line 1,479 ⟶ 1,415:
divert
max
undivert(1)</lang>
</lang>
 
Output:
99
<pre>
99
@ 2008/10/03_08:39:34 @ 2008/10/03_08:40:40
</pre>
 
=={{header|Mathematica}}==
Line 1,497 ⟶ 1,429:
 
Output:
<pre> -> The maximum number of licenses used was 99, at {2008/10/03_08:39:34,2008/10/03_08:40:40}</pre>
 
=={{header|MAXScript}}==
Line 1,543 ⟶ 1,475:
licencesInUse()</lang>
Output
<pre> Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34
2008/10/03_08:40:40</pre>
 
=={{header|Nim}}==
Line 1,567 ⟶ 1,499:
for i in maxTimes: echo " ",i</lang>
Output:
<pre> Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34
2008/10/03_08:40:40</pre>
 
=={{header|OCaml}}==
Line 1,603 ⟶ 1,535:
=={{header|Oz}}==
{{trans|Python}}
 
<lang oz>declare
fun {MaxLicenses Filename ?Times}
Line 1,655 ⟶ 1,586:
 
Output:
Maximum simultaneous license use is 99 at the following times:
<pre>
2008/10/03_08:39:34
Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:3940:3440
2008/10/03_08:40:40
</pre>
 
=={{header|PARI/GP}}==
Line 1,680 ⟶ 1,609:
rec
};</lang>
<pre> ["2008/10/03_08:39:34", "2008/10/03_08:40:40"]
%1 = 99</pre>
 
=={{header|Perl}}==
Line 1,712 ⟶ 1,641:
print " $_\n" foreach @max_times;</lang>
Example output:
<pre> Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34
2008/10/03_08:40:40
 
</pre>
 
=={{header|Perl 6}}==
Line 1,750 ⟶ 1,679:
 
Example output:
Maximum concurrent licenses in use: 99, in the time periods:
<pre>
2008/10/03_08:39:34 through 2008/10/03_08:39:45,
Maximum concurrent licenses in use: 99, in the time periods:
2008/10/03_08:3940:3440 through 2008/10/03_08:3940:45,47
2008/10/03_08:40:40 through 2008/10/03_08:40:47
</pre>
 
=={{header|Phix}}==
Line 1,793 ⟶ 1,720:
end for</lang>
{{out}}
Maximum simultaneous license use is 99 at the following times:
<pre>
2008/10/03_08:39:34
Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:3940:3440
2008/10/03_08:40:40
</pre>
 
=={{header|PHP}}==
Line 1,829 ⟶ 1,754:
echo $times[$i] . '<br>';
}</lang>
99
<pre>
2008/10/03_08:39:34
99
2008/10/03_08:3940:3440
2008/10/03_08:40:40
</pre>
 
=={{header|PL/I}}==
<lang pli>text3: procedure options (main); /* 19 November 2011 */
<lang pli>
text3: procedure options (main); /* 19 November 2011 */
declare line character (80) varying;
declare (nout, max_nout) fixed;
Line 1,872 ⟶ 1,794:
free saveline;
end;
end text3;</lang>
</lang>
OUTPUT:
The maximum number of licences taken out = 99
<pre>
It occurred at 2008/10/03_08:40:40 for job 1837
The maximum number of licences taken out = 99
It occurred at 2008/10/03_08:4039:4034 for job 18371833
It occurred at 2008/10/03_08:39:34 for job 1833
</pre>
 
=={{header|PicoLisp}}==
{{trans|AWK}}
 
Put the following into an executable file "licenses":
<lang PicoLisp>#!/usr/bin/picolisp /usr/lib/picolisp/lib.l
Line 1,905 ⟶ 1,823:
(bye)</lang>
Then it can be called as
<pre> $ ./licenses mlijobs.txt
The biggest number of licenses is 99 at 2008/10/03_08:39:34 and 2008/10/03_08:40:40 !</pre>
 
=={{header|PowerShell}}==
<lang PowerShell>[int]$count = 0
[int]$count = 0
[int]$maxCount = 0
[datetime[]]$times = @()
Line 1,954 ⟶ 1,871:
StartTime = $times[0]
EndTime = $times[1]
}</lang>
}
</lang>
{{Out}}
LicensesOut StartTime EndTime
<pre>
LicensesOut ----------- StartTime--------- EndTime-------
99 10/3/2008 8:39:34 AM 10/3/2008 8:40:40 AM
----------- --------- -------
99 10/3/2008 8:39:34 AM 10/3/2008 8:40:40 AM
</pre>
 
=={{header|PureBasic}}==
Line 1,989 ⟶ 1,903:
PrintN(#CRLF$+"Press ENTER to exit"): Input()
CloseConsole()</lang>
99 license(s) used at ;
<pre>
2008/10/03_08:39:34
99 license(s) used at ;
2008/10/03_08:3940:3440
2008/10/03_08:40:40
Press ENTER to exit
 
Press ENTER to exit
</pre>
 
=={{header|Python}}==
Line 2,008 ⟶ 1,920:
print("Maximum simultaneous license use is %i at the following times:" % max_out)
print(' ' + '\n '.join(max_times))</lang>
 
{{out}}
<pre> Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34
2008/10/03_08:40:40
</pre>
 
=={{header|R}}==
<lang R># Read in data, discard useless bits
<lang R>
# Read in data, discard useless bits
dfr <- read.table("mlijobs.txt")
dfr <- dfr[,c(2,4)]
Line 2,026 ⟶ 1,935:
when.most.checked.out <- times[which(n.checked.out==most.checked.out)]
# As a bonus, plot license use
plot(times, n.checked.out, type="s")</lang>
</lang>
 
=={{header|Racket}}==
Line 2,055 ⟶ 1,963:
(printf "Maximum licences in simultaneously used is ~a at the following times:~%"
max-used)
(for-each displayln max-used-when)</lang>
</lang>
Output:
<pre> Maximum licences in simultaneously used is 99 at the following times:
2008/10/03_08:39:34
2008/10/03_08:40:40</pre>
 
The following takes advantage of a combination of ''for/fold'' and ''(in-lines)'' (and is possible more in the Racket idiom, rather than just using ''(read-line)'' and ''(regexp-match)'':
 
Line 2,112 ⟶ 2,018:
end /*j*/ /*stick a fork in it, we're all done. */</lang>
'''output''' &nbsp; when using the default input file:
<pre>10000 records read from the input file: LICENSE.LOG
<pre>
10000 records read from the input file: LICENSE.LOG
The maximum number of licenses out is 99 at:
 
2008/10/03_08:39:34 for job 1833
2008/10/03_08:40:40 for job 1837</pre>
</pre>
 
===Version 2 dual-coded for PC and TSO===
It should be noted that almost every REXX interpreter returns a different string for &nbsp; '''parse source''' &nbsp; under Microsoft Windows:
Line 2,198 ⟶ 2,101:
Return</lang>
{{out}} on Windows
<pre>D:\>rexx maxl
D:\>rexx maxl
WindowsNT COMMAND D:\maxl.rex
The maximum number of licences taken out = 99
Line 2,264 ⟶ 2,166:
 
Example output:
<pre> Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34
2008/10/03_08:40:40
</pre>
=={{header|Run BASIC}}==
<lang lb>open "c:\data\temp\logFile.txt" for input as #f
Line 2,282 ⟶ 2,183:
wend
print maxCount;" ";theDate$</lang>
 
=={{header|Scala}}==
=== Dumb imperative translations ===
The boolean logic e.g. is rather clumsy.
{{trans|Ada}}
{{trans|ALGOL 68}}
{{trans|AutoHotkey}}
{{trans|AWK}}
{{trans|Common Lisp}}
{{trans|E}}
{{trans|Fortran}}
{{trans|Go}}
{{trans|Python}}
{{trans|Java}}
{{trans|Julia}}
{{trans|MAXScript}}
{{trans|Nim}}
{{trans|OCaml}}
{{trans|Perl}}
{{trans|PL/I}}
{{trans|PureBasic}}
{{trans|R}}
{{trans|REXX}}
{{trans|Ruby}}
{{trans|Run BASIC}}
{{trans|Sidef}}
{{trans|Tcl}}
{{trans|Zcl}}
{{Out}}Best seen running in your browser [https://scastie.scala-lang.org/lTzl4t0cRFORGs9YWtvgAQ Scastie (remote JVM)].
<lang Scala>import java.io.{BufferedReader, InputStreamReader}
import java.net.URL
 
object License0 extends App {
val url = new URL("https://raw.githubusercontent.com/def-/nim-unsorted/master/mlijobs.txt")
val in = new BufferedReader(new InputStreamReader(url.openStream()))
 
val dates = new collection.mutable.ListBuffer[String]
var (count: Int, max: Int) = (0, Int.MinValue)
var line: String = _
 
while ( {line = in.readLine; line} != null) {
if (line.startsWith("License OUT ")) count += 1
if (line.startsWith("License IN ")) count -= 1 // Redundant test when "OUT"
if (count > max) { // Fruitless execution when "License IN "
max = count
val date = line.split(" ")(3)
dates.clear()
dates += date
} else if (count == max) {
val date = line.split(" ")(3)
dates += date
}
}
 
println("Max licenses out: " + max)
println("At time(s): " + dates)
 
}</lang>
{{in progress|lang=LANG|day=DD|month=MM|year=YYYY}}
//
 
=={{header|Seed7}}==
Line 2,317 ⟶ 2,278:
end for;
end func;</lang>
 
Output:
Maximum simultaneous license use is 99 at the following times:
<pre>
2008/10/03_08:39:34
Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:3940:3440
2008/10/03_08:40:40
</pre>
 
=={{header|Sidef}}==
Line 2,345 ⟶ 2,303:
max_times.each {|t| " #{t}".say };</lang>
{{out}}
$ sidef max_licenses.sf < mlijobs.txt
<pre>
Maximum simultaneous license use is 99 at the following times:
$ sidef max_licenses.sf < mlijobs.txt
Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34
2008/10/03_08:40:40
</pre>
 
=={{header|Tcl}}==
 
{{trans|Python}}
 
<lang tcl> set out 0
set max_out -1
Line 2,379 ⟶ 2,333:
puts " $t"
}</lang>
 
Output matches Python
=={{header|TUSCRIPT}}==
<lang tuscript>$$ MODE TUSCRIPT
$$ MODE TUSCRIPT
joblog="mlijobs.txt",jobnrout=0
log=FILE (joblog)
Line 2,400 ⟶ 2,352:
times=SELECT (time,#maxlicout)
PRINT "The max. number of licences out is ", maxlicout
PRINT "at these times: ", times</lang>
</lang>
Output:
The max. number of licences out is 99
<pre>
at these times: 2008/10/03_08:39:34 2008/10/03_08:40:40
The max. number of licences out is 99
at these times: 2008/10/03_08:39:34 2008/10/03_08:40:40
</pre>
 
=={{header|Ursala}}==
Four functions are defined. Log lexes the log file, which can be accessed as a pre-declared constant without explicit I/O by being given as a compile-time command line parameter. Scan accumulates running totals of licenses in use. Search identifies the maxima, and format transforms the results to human readable form.
<lang Ursala>#import std
 
<lang Ursala>
#import std
#import nat
 
Line 2,424 ⟶ 2,371:
main = format search scan log</lang>
output:
<pre> 99 licenses in use at
2008/10/03_08:39:34
2008/10/03_08:40:40
</pre>
 
=={{header|Vedit macro language}}==
Line 2,457 ⟶ 2,403:
Reg_Type(10)
 
Buf_Quit(OK)</lang>
</lang>
 
Output:
<pre>Maximum simultaneous license use is 99 at the following times:
<pre>
Maximum simultaneous license use is 99 at the following times:
2008/10/03_08:39:34 for job 1833
2008/10/03_08:40:40 for job 1837</pre>
</pre>
 
=={{header|zkl}}==
Line 2,480 ⟶ 2,423:
" the following times:\n %s").fmt(maxOut,maxTimes.concat("\n")));</lang>
{{out}}
<pre>Maximum simultaneous license use is 1 at the following times:
<pre>
2008/10/03_23:51:05</pre>
Maximum simultaneous license use is 1 at the following times:
2008/10/03_23:51:05
</pre>
 
 
{{omit from|GUISS}}
Anonymous user