File size distribution: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: simplified a statement.) |
m (→{{header|REXX}}: optimized the file reading.) |
||
Line 422: | Line 422: | ||
sw=linesize() - 1; if sw<80 then sw=79 /* " terminal width (linesize) - 1.*/ |
sw=linesize() - 1; if sw<80 then sw=79 /* " terminal width (linesize) - 1.*/ |
||
dirOut= fn".OUT" /*construct filename for output of DIR.*/ |
dirOut= fn".OUT" /*construct filename for output of DIR.*/ |
||
'DIR' ds '/s /a-d >' dirOut |
'DIR' ds '/s /-c /a-d >' dirOut /*do (DOS) DIR cmd for a data structure*/ |
||
call linein 0, 1 /*open output file, point to 1st record*/ |
call linein 0, 1 /*open output file, point to 1st record*/ |
||
maxL=0 /*maximum length of number of records. */ |
maxL=0 /*maximum length of number of records. */ |
||
Line 430: | Line 430: | ||
_=linein(dirOUT); if left(_, 1)==' ' then iterate /*process data. */ |
_=linein(dirOUT); if left(_, 1)==' ' then iterate /*process data. */ |
||
parse upper var _ dat tim sz . /*uppercase suffix*/ |
parse upper var _ dat tim sz . /*uppercase suffix*/ |
||
sz=space( translate(sz, , ",ÿ"'ff'x), 0) /*SZ has "commas"?*/ |
|||
if \datatype(sz,'W') then do; #=left(sz, length(sz) - 1) /*SZ has a suffix?*/ |
if \datatype(sz,'W') then do; #=left(sz, length(sz) - 1) /*SZ has a suffix?*/ |
||
if \datatype(#,'N') then iterate /*Meat ¬ numeric? */ |
if \datatype(#,'N') then iterate /*Meat ¬ numeric? */ |