#!/usr/bin/perl use strict; use warnings; my @keywords = qw( übertroffen erreicht motiviert); my @files = glob('/path/to/files'); my $regexp = join('|', map{ qr/\Q$_\E/ }sort{ length($b) <=> length($a) }@keywords ); for my $file (@files) { if( open(my $fh, '<', $file) ) { print "\n\n$file\n"; my $lc = 0; while( my $line = <$fh> ) { lc++; if($line =~/(\d{10})/) { print "Zeile $lc: $1\n"; } my $rc = 1; while( $line=~/^(.*?)($regexp)// ) { $rc+=length($1); print "Spalte $rc/ Zeile $lc: $2\n"; $rc+=length($2); } } close($fh); } else { warn "$file ERROR OPEN $!\n"; next; } }