Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Text-processing-2/Factor/text-processing-2.factor
Normal file
11
Task/Text-processing-2/Factor/text-processing-2.factor
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
USING: io io.encodings.ascii io.files kernel math math.parser
|
||||
prettyprint sequences sequences.extras sets splitting ;
|
||||
|
||||
: check-format ( seq -- )
|
||||
[ " \t" split length 49 = ] all?
|
||||
"Format okay." "Format not okay." ? print ;
|
||||
|
||||
"readings.txt" ascii file-lines [ check-format ] keep
|
||||
[ "Duplicates:" print [ "\t" split1 drop ] map duplicates . ]
|
||||
[ [ " \t" split rest <odds> [ string>number 0 <= ] none? ] count ]
|
||||
bi pprint " records were good." print
|
||||
Loading…
Add table
Add a link
Reference in a new issue