Text processing/Max licenses in use: Difference between revisions

added J
(added J)
Line 12:
*Note: The page uses javascript to display a text file, so it may be best to cut-n-paste from a browser to a text file rather than downloading the URL.
 
== {{header|J}} ==
NB. Verb to parse data
cutf =: [: ({.~ _ , 43 >. {:@:$) (];._2~ =&LF)
cut =: (<;.2~ <nowiki>''</nowiki> ; 7 11 13 33 37 41 (i.@:] e. (,<:)) {:@:$)@:cutf
NB. Parse data, select columns
'D J' =: 3 6 { |: cut CR -.~ 1!:1 <'licenses.txt'
NB. Calculate number of licenses used at any given time
lu =: +/ ~:/\"1 = 0".J
NB. Find the maxima
mx =: (I.@:=>./) lu
NB. Output results
mx { D ,~ 'Maximum simultaneous license use is ' , ' at the following times:' ,~ ": {. mx { lu
2008/10/03_08:39:30
2008/10/03_08:40:11
=={{header|Python}}==
Python 2.6
Anonymous user