summaryrefslogtreecommitdiff
path: root/corpus/paste-files.pl
diff options
context:
space:
mode:
authorAvneesh Saluja <asaluja@gmail.com>2013-03-28 18:28:16 -0700
committerAvneesh Saluja <asaluja@gmail.com>2013-03-28 18:28:16 -0700
commit5b8253e0e1f1393a509fb9975ba8c1347af758ed (patch)
tree1790470b1d07a0b4973ebce19192e896566ea60b /corpus/paste-files.pl
parent2389a5a8a43dda87c355579838559515b0428421 (diff)
parentb203f8c5dc8cff1b9c9c2073832b248fcad0765a (diff)
fixed conflicts
Diffstat (limited to 'corpus/paste-files.pl')
-rwxr-xr-xcorpus/paste-files.pl13
1 files changed, 12 insertions, 1 deletions
diff --git a/corpus/paste-files.pl b/corpus/paste-files.pl
index 24c70599..ef2cd937 100755
--- a/corpus/paste-files.pl
+++ b/corpus/paste-files.pl
@@ -17,6 +17,7 @@ for my $file (@ARGV) {
binmode(STDOUT,":utf8");
binmode(STDERR,":utf8");
+my $bad = 0;
my $lc = 0;
my $done = 0;
my $fl = 0;
@@ -33,8 +34,17 @@ while(1) {
$done = 1;
last;
}
+ $r =~ s/\r//g;
chomp $r;
- die "$ARGV[$anum]:$lc contains a ||| symbol - please remove.\n" if $r =~ /\|\|\|/;
+ if ($r =~ /\|\|\|/) {
+ $r = '';
+ $bad++;
+ }
+ warn "$ARGV[$anum]:$lc contains a ||| symbol - please remove.\n" if $r =~ /\|\|\|/;
+ $r =~ s/\|\|\|/ /g;
+ $r =~ s/\s+/ /g;
+ $r =~ s/^ +//;
+ $r =~ s/ +$//;
$anum++;
push @line, $r;
}
@@ -47,4 +57,5 @@ for (my $i = 1; $i < scalar @fhs; $i++) {
my $r = <$fh>;
die "Mismatched number of lines.\n" if defined $r;
}
+print STDERR "Number of lines containing ||| was: $bad\n" if $bad > 0;