Text processing/2: Difference between revisions

Content added Content deleted
(Added Nim solution)
m (→‎{{header|Sidef}}: modified the code to work with Sidef 2.30)
Line 2,615: Line 2,615:
{{trans|Perl 6}}
{{trans|Perl 6}}
<lang ruby>var good_records = 0;
<lang ruby>var good_records = 0;
var dates = Hash.new;
var dates = Hash();


ARGF.each { |line|
ARGF.each { |line|
Line 2,627: Line 2,627:
say "#{good_records} good records out of #{$.} total";
say "#{good_records} good records out of #{$.} total";
say 'Repeated timestamps:';
say 'Repeated timestamps:';
say dates.pairs.grep{ .second > 1 }.map { .first }.sort.join("\n");</lang>
say dates.to_a.grep{ .value > 1 }.map { .key }.sort.join("\n");</lang>
{{out}}
{{out}}
<pre>
<pre>