Text processing/2: Difference between revisions

Add Factor
m (→‎{{header|Sidef}}: Fix link: Perl 6 --> Raku)
(Add Factor)
Line 951:
5017 records were ok
</lang>
 
=={{header|Factor}}==
{{works with|Factor|0.99 2020-03-02}}
<lang factor>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</lang>
{{out}}
<pre>
Format okay.
Duplicates:
{
"1990-03-25"
"1991-03-31"
"1992-03-29"
"1993-03-28"
"1995-03-26"
}
5017 records were good.
</pre>
 
=={{header|Fortran}}==
1,808

edits