Text processing/Max licenses in use: Difference between revisions

no edit summary
(→‎{{header|J}}: use files library)
No edit summary
Line 486:
mapM_ (putStrLn . (dt!!)) . elemIndices mo $ cio
</lang>
 
 
=={{header|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).
<lang HicEst>CHARACTER Licenses="Licenses.txt"
REAL :: counts(1), Top10(10)
 
OPEN(FIle=Licenses, fmt='8x,A3,3x,A19,Nb ,', LENgth=lines)
 
ALLOCATE(counts, lines)
counts(1) = 1
DO line = 2, lines
counts(line) = counts(line-1) + 1 - 2*(Licenses(line,1)=='IN')
ENDDO
 
SORT(Vector=counts, Descending=1, Index=Top10)
 
DO i = 1, LEN(Top10)
WRITE() counts(Top10(i)), Licenses(Top10(i), 2)
ENDDO
 
END</lang>
<pre>99 2008/10/03_08:40:40
99 2008/10/03_08:39:34
98 2008/10/03_08:40:47
98 2008/10/03_08:40:11
98 2008/10/03_08:39:46
98 2008/10/03_08:39:45
98 2008/10/03_08:39:30
97 2008/10/03_20:44:58
97 2008/10/03_08:41:36
97 2008/10/03_08:40:53</pre>
 
== {{header|J}} ==
Anonymous user