#!/usr/bin/perl use warnings; use strict; open(EIN, ") { chomp; my @f = split(/\t/); $pnr1{join('|',@f[1..2])} = 1; ++$cnt % 1000 or print "Bei Satz $cnt.\n" } # while print "Fertig mit $cnt Saetzen.\n"; close(EIN) or die $!; open(EIN, "Gefunden.txt") or die $!; $cnt = 0; while() { my $vergleich = su_strip(su_strip(substr($_,67,30))."|".substr($_,157,30)); print AUS $_ if defined $pnr1{$vergleich}; ++$cnt % 1000 or print "Bei Satz $cnt.\n" } # while print "Fertig mit $cnt Saetzen.\n"; close(EIN) or die $!; close(AUS) or die $!; sub su_strip { my $s = shift; $s =~ s/\s+$//; $s =~ s/^\s+//; $s; }