Text processing/1: Difference between revisions

Content added Content deleted
(→‎Process file in chunks: add commentary)
(→‎Common utilities: formatting)
Line 517:
 
<lang j>
require 'files' NB. for fread/freadblock/fapplylines
 
NB. Utility verbs
mean=: +/ % #
summarize=: # , +/ , mean NB. count , sum , mean
filter=: #~ 0&< NB. keep left arg where 0 < right arg
 
NB. LongestFind longest run(s) of successive invalid measurements and return
NB. length and date of last measurement(s) in run(s)
NB. Takes matrix of flags as right argument
findLongestRuns=: 3 : 0
badflags=. , 0 >: y
Line 552 ⟶ 554:
)
</lang>
 
 
=== Process whole file at once ===