V
Vumani Dlamini
This problem follows up on a couple of problems I sent to the list 2
months back. The data is structured as follows;
##### data #########
Area=3706
Company=101
PROPdes=1 # description/type of property
PROPpri=2 # public/private
PROPemp=54 # number of employees
PROPdes=6
PROPpri=2
PROPemp=23
Company=106
PROPdes=4
PROPpri=2
PROPemp=56
Area=3709
Company=116
PROPdes=9
PROPpri=1
PROPemp=200
###################
And the data set created is;
3706|101|1|2|054
3706|101|6|2|023
3706|106|4|2|056
3709|116|9|1|200
using the following Perl script;
##### Perl script ######
use strict;
use warnings;
open DATA, "c:/../properties.txt" or die "Unable to open file:$\n";
my ($Area , $Comp, $Pdes, $Ppri, $Pemp);
open PRIVATE, ">c:/.../private.txt";
while (<DATA>){
if (/Area=(\d+)/) {
$Area = $1;
}
elsif (/Company=(\d+)/) {
$Comp = $1;
}
elsif (/PROPdes=(\d+)/) {
$Pdes = $1;
}
elsif (/PROPpri=(\d+)/) {
$Ppri = $1;
}
elsif (/PROPemp=(\d+)/) {
print PRIVATE "$Area$Comp$Pdes$Ppri$1\n";
}
}
}
##### Perl script ######
I now have a "area text file" with specific companies that have to be
extracted, with each row in the "area text file" having a code for an
area. I would like to extract companies only in areas listed in the
"area text file".
If within the areas in the "area text file" I am only interested in
areas with more than 10 companies, is it possible to write a script
which utilizes all this information?
Thanks al lot, again.
Vumani Dlamini
PS: My previous posts related to this problem can be found here:
http://groups.google.nl/[email protected]
http://groups.google.nl/[email protected]
http://groups.google.nl/[email protected]
http://groups.google.nl/[email protected]
http://groups.google.nl/[email protected]
http://groups.google.nl/[email protected]
months back. The data is structured as follows;
##### data #########
Area=3706
Company=101
PROPdes=1 # description/type of property
PROPpri=2 # public/private
PROPemp=54 # number of employees
PROPdes=6
PROPpri=2
PROPemp=23
Company=106
PROPdes=4
PROPpri=2
PROPemp=56
Area=3709
Company=116
PROPdes=9
PROPpri=1
PROPemp=200
###################
And the data set created is;
3706|101|1|2|054
3706|101|6|2|023
3706|106|4|2|056
3709|116|9|1|200
using the following Perl script;
##### Perl script ######
use strict;
use warnings;
open DATA, "c:/../properties.txt" or die "Unable to open file:$\n";
my ($Area , $Comp, $Pdes, $Ppri, $Pemp);
open PRIVATE, ">c:/.../private.txt";
while (<DATA>){
if (/Area=(\d+)/) {
$Area = $1;
}
elsif (/Company=(\d+)/) {
$Comp = $1;
}
elsif (/PROPdes=(\d+)/) {
$Pdes = $1;
}
elsif (/PROPpri=(\d+)/) {
$Ppri = $1;
}
elsif (/PROPemp=(\d+)/) {
print PRIVATE "$Area$Comp$Pdes$Ppri$1\n";
}
}
}
##### Perl script ######
I now have a "area text file" with specific companies that have to be
extracted, with each row in the "area text file" having a code for an
area. I would like to extract companies only in areas listed in the
"area text file".
If within the areas in the "area text file" I am only interested in
areas with more than 10 companies, is it possible to write a script
which utilizes all this information?
Thanks al lot, again.
Vumani Dlamini
PS: My previous posts related to this problem can be found here:
http://groups.google.nl/[email protected]
http://groups.google.nl/[email protected]
http://groups.google.nl/[email protected]
http://groups.google.nl/[email protected]
http://groups.google.nl/[email protected]
http://groups.google.nl/[email protected]