/ Published in: Perl
                    
                                        
Used to extract the various config parameters from the TRA file
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
#!/user/bin/perl -w
use strict;
use File::Find;
my @DIRLIST = ("c:\\scratch", "c:\\sukanta\\scratch");
# Returns the SBRRES_* tables, there can be duplicate tokens
sub extract_tra_params {
my %params = ();
# read the input file
while(<FILE>) {
if (/^(java.heap.size.max)=(.*)$/) {
$params{$1} = $2;
}
elsif (/^(java.heap.size.initial)=(.*)$/) {
$params{$1} = $2;
}
elsif (/^(tibco.deployment)=(.*)$/) {
$params{$1} = $2;
}
elsif (/^(FlowLimit.*)=(.*)$/) {
$params{$1} = $2;
}
elsif (/^(MaxJobs.*)=(.*)$/) {
$params{$1} = $2;
}
elsif (/^(Engine.ThreadCount)=(.*)$/) {
$params{$1} = $2;
}
elsif (/^(java.thread.stack.size)=(.*)$/) {
$params{$1} = $2;
}
elsif (/^(Hawk.Daemon)=(.*)$/) {
$params{$1} = $2;
}
else {
}
}
# find the unique tables
}
sub pretty_print {
my $key;
my (%params) = @_;
}
}
#
# This function will be called for each file by the find function
#
sub process_file {
my $fname = $_;
my %params = ();
%params = extract_tra_params($fname);
pretty_print(%params);
}
}
find(\&process_file, @DIRLIST);
Comments
 Subscribe to comments
                    Subscribe to comments
                
                