mirror of
https://github.com/Helsinki-NLP/OPUS-MT-train.git
synced 2024-09-11 12:25:37 +03:00
20 lines
333 B
Perl
Executable File
20 lines
333 B
Perl
Executable File
#!/usr/bin/env perl
|
|
#
|
|
# simple script for filling/clipping data to a certain size
|
|
# in number of lines
|
|
|
|
use strict;
|
|
|
|
my $size = shift(@ARGV);
|
|
my $file = shift(@ARGV);
|
|
|
|
my $count=0;
|
|
while ($count < $size){
|
|
open F,"<$file" || die "cannot read from $file!\n";
|
|
while (<F>){
|
|
$count++;
|
|
print;
|
|
last if ($count >= $size);
|
|
}
|
|
}
|