Getting a bit stuck. Would appreciate any help?
Thanks
I have a list of names.
Each name corresponds to a profile on a txt document.
Each txt document profile contains a section called address
I am only interested in those names that are in Texas as well as those specifically in Austin, Texas.
File format of Address section in profile
N.B The city and state are always abbreviated to 8 letters
Address: 34
Address: CITY
Address: STATE
I can group all the names so that I know how many are in Texas. But I am trying to further separate this into two groups one where AUSTIN is the city.
Any ideas?
Thanks
I have a list of names.
Each name corresponds to a profile on a txt document.
Each txt document profile contains a section called address
I am only interested in those names that are in Texas as well as those specifically in Austin, Texas.
File format of Address section in profile
N.B The city and state are always abbreviated to 8 letters
Address: 34
Address: CITY
Address: STATE
I can group all the names so that I know how many are in Texas. But I am trying to further separate this into two groups one where AUSTIN is the city.
Any ideas?
Code:
foreach $name (@WEBSITE) {
foreach $line (@ADDRESS){
if ($line =~ /^Address/){
$address = substr($line,9,8);
if ($address eq "TEXAS"){
open (ADDRESSBOOK, ">address.txt");
push (@ADDRESS, $name);
print ADDRESSBOOK "@ADDRESS\n";
$counter++;
last;
}
}
}
}