thank you to both of you! i can post my script. i did not write it. i do not know perl and am trying to learn. this was given to me to get it working.
stevexff your reply is what i was looking for. it gives me a starting point.
though here is a script! as matter of fact if one you can get it working for me i will gladly donate $ to you via pay pal.
#!/usr/bin/perl
use strict;
use warnings;
my $Folder ="C:/";
opendir FOLDER,"$Folder";
my @InFiles =grep !/^\.\.?$/, "C:/SECFiles/".+readdir FOLDER;
closedir FOLDER;
foreach my $listitem ( @InFiles )
{
print "$listitem\n";
}
my $outFile = "C:/SECFiles/holdingsout.txt";
open (OUTFILE,">>$outFile");
foreach (@InFiles) {
# Read data
my $Data;
unless(open (FILE,"<$_")){
print STDERR "could not open $_: $!\n";
next;
}
local $/;
$Data=<FILE>;
#Get info from data at top
my($CompanyConformedName) = $Data =~ /FILER:\s+COMPANY DATA:\s+COMPANY CONFORMED NAME:\s+(.+?)$/sm;
my($CompanyStreet1) = $Data =~ /\s+BUSINESS ADDRESS:\s+STREET 1:\s+(.+?)$/sm;
my($CompanyStreet2) = $Data =~ /\s+BUSINESS ADDRESS:\s+STREET 1:\s+$CompanyStreet1\s+STREET 2:\s+(.+?)$/sm;
my($CompanyCity) = $Data =~ /\s+BUSINESS ADDRESS:\s+STREET 1:\s+$CompanyStreet1\s+STREET 2:\s+$CompanyStreet2\s+CITY:\s+(.+?)$/sm;
my($CompanyState) = $Data =~ /\s+BUSINESS ADDRESS:\s+STREET 1:\s+$CompanyStreet1\s+STREET 2:\s+$CompanyStreet2\s+CITY:\s+$CompanyCity\s+STATE:\s+(.+?)$/sm;
my($CompanyZip) = $Data =~ /\s+BUSINESS ADDRESS:\s+STREET 1:\s+$CompanyStreet1\s+STREET 2:\s+$CompanyStreet2\s+CITY:\s+$CompanyCity\s+STATE:\s+$CompanyState\s+ZIP:\s+(.+?)$/sm;
my($CompanyPhone) = $Data =~ /\s+BUSINESS ADDRESS:\s+STREET 1:\s+$CompanyStreet1\s+STREET 2:\s+$CompanyStreet2\s+CITY:\s+$CompanyCity\s+STATE:\s+$CompanyState\s+ZIP:\s+$CompanyZip\s+BUSINESS PHONE:\s+(.+?)$/sm;
my($DateFiled) = $Data =~ /FILED AS OF DATE:\s+(.+?)$/sm;
my($PeriodEnded) = $Data =~ /CONFORMED PERIOD OF REPORT:\s+(.+?)$/sm;
my($SEC) = $Data =~ /SEC FILE NUMBER:\s+(.+?)$/sm;
my($Principal) = $Data =~ /Person Signing this Report on Behalf of Reporting Manager:\s+Name:\s+(.+?)$/sm;
my($PrinTit) = $Data =~ /Title:\s+(.+?)$/sm;
my($PrinPhone) = $Data =~ /Phone:\s+(.+?)$/sm;
#Remove data at top
$Data =~ s/\A(.*^[-\s]{100,}$)//sm;
#Seperate into lines
my @Lines = split(/\n/,$Data);
shift @Lines;
shift @Lines;
#print data to outfile
while(my $Line = shift @Lines){
next if $Line =~ /^\s/;
my @f=split(/\s{2,}/, $Line);
print OUTFILE "OWNER=$CompanyConformedName\t";
print OUTFILE "Street1=$CompanyStreet1\t";
print OUTFILE "Street2=$CompanyStreet2\t";
print OUTFILE "City=$CompanyCity\t";
print OUTFILE "State=$CompanyState\t";
print OUTFILE "Zip=$CompanyZip\t";
print OUTFILE "CompanyPhone=$CompanyPhone\t";
print OUTFILE "DateFiled=$DateFiled\t";
print OUTFILE "PeriodEnded=$PeriodEnded\t";
print OUTFILE "SEC=$SEC\t";
print OUTFILE "Principal=$Principal\t";
print OUTFILE "PrTitle=$PrinTit\t";
print OUTFILE "PrinPhone=$PrinPhone\t";
print OUTFILE "Stock=$f[0]\t";
print OUTFILE "cusip=$f[2]\t";
print OUTFILE "value=$f[3]\t";
print OUTFILE "prn=$f[4]\n";
}
}
other info:
i can put script in my c:/ or c:/SECFiles
the file names are going to have .txt extension
but name can have any alphanumeric characters.
thanks