Hello I have a text which looks like this:
And lets say I have a Phone number that looks like this:
39349562486245
and a Entry in a file that looks like this:
1002978;ITM;39349;ITALIEN MOBIL;5;0;414;177
Now The beginning of the Number matches with the one down there how can I check if does begin with that number in Perl. So I am this far but it doesent work:
zeile[5] Is the Phone Number.
open( DATEIMAIN, "<$dateimainc" ) || die("Datei $dateimainc kann nicht geöffnet werden!");
my @zeilenMAIN = <DATEIMAIN>;
for(my $lineNMAIN = 1; $lineNMAIN < @zeilenMAIN; $lineNMAIN++)
{
@zeileMAINC = split( /;/, $zeilenMAIN[$lineNMAIN] );
if ($zeile[5] =~ /^$zeileMAINC[2]/)
{
$displaynameB = $zeileMAINC[3];
last;
}
}
Build a hash of string prefixes, then use that: