File size distribution: Difference between revisions

m
→‎{{header|REXX}}: added a summary (totals).
m (→‎{{header|REXX}}: added the REXX computer programming language.)
m (→‎{{header|REXX}}: added a summary (totals).)
Line 417:
@.=00 /*stemmed array to hold record counts. */
g=0 /*number of good records found (so far)*/
$=0; do while lines(dirOut) \== 0
$_=linein(dirOUT); if left($_, 1)==' ' then iterate /*process data. */
parse upper var $ dat tim_ sz . dat tim sz . /*uppercase suffix*/
if pos('/', dat) ==0 | pos(":", tim)==0 then iterate /*validate dat&tim*/
if pos(',', sz) \==0 then sz=space( translate(sz, , ","), 0) /*SZ has commas? */
Line 427:
sz=# * 1024 **pos(sfx,'KMGT')/1 /*compute true val*/
end
$=$ + sz /*stickkeep a fork in it, running we'retotal allfor done.the filesize*/
if sz==0 then L=0 /*handle special case for an empty file*/
else L=length(sz) /*obtain the length of filesize number.*/
Line 451 ⟶ 452:
end /*k*/
end /*y*/
say
/*stick a fork in it, we're all done. */
'ERASE' dirOut /*perform clean─up (erase a work file).*/</lang>
say g ' files detected,' $ " total bytes." /*stick a fork in it, we're all done. */</lang>
{{out|output|text=&nbsp; when using the default input: &nbsp; (which in this case was the &nbsp; '''C:''' &nbsp; drive.)}}
<pre>
Line 468 ⟶ 470:
10^8 ──► 10^9 -1 3 ─
10^9 ──► 10^10 -1 1 ─
 
55537 files detected, 12656297888 total bytes.
</pre>