I am trying to get this perl script to read file from a folder. I keep getting the following error. Script at bottom.
C:\>Perl -w C:\PerlScripts\PerlParserF
orEdgar.pl
C:/PerlScripts/SECFolder/.
could not open C:/PerlScripts/SECFolder/.
: Permission denied
C:\>Perl -w C:\PerlScripts\PerlParserF
orEdgar.pl
Montag.txt
test.txt
could not open Montag.txt: No such file or directory
could not open test.txt: No such file or directory
These are the files in the folder. I think i just need a way to get fullpath.
I tried to do this in script by concat but i am doing something wrong.
Second, The script which is mainly written by adam is great but it doesn't seem to read the table at the bottom of this .txt file below.
-----BEGIN PRIVACY-ENHANCED MESSAGE-----
Proc-Type: 2001,MIC-CLEAR
Originator-Name: webmaster@
www.sec.govOriginator-Key-Asymmetric:
MFgwCgYEVQgBAQICAf8DSgAwRw
JAW2sNKK9A
VtBzYZmr6a
GjlWyK3XmZ
v3dTINen
TWSM7vrzLADbmYQaionwg5sDW3
P6oaM5D3td
ezXMm7z1T+
B+twIDAQAB
MIC-Info: RSA-MD5,RSA,
N4spgAMfNBKaa7Uzv3hbPZEJhY
40vr8D9RWH
ipvLD6dYRk
IbOKzlLSDv
O3Wd+7Rg
MXVvtj2tdzSaT/3BbtXcoA==
<SEC-DOCUMENT>0001179232-0
7-000006.t
xt : 20070501
<SEC-HEADER>0001179232-07-
000006.hdr
.sgml : 20070501
<ACCEPTANCE-DATETIME>20070
501172730
ACCESSION NUMBER: 0001179232-07-000006
CONFORMED SUBMISSION TYPE: 13F-HR
PUBLIC DOCUMENT COUNT: 1
CONFORMED PERIOD OF REPORT: 20070331
FILED AS OF DATE: 20070501
DATE AS OF CHANGE: 20070501
EFFECTIVENESS DATE: 20070501
FILER:
COMPANY DATA:
COMPANY CONFORMED NAME: FOUNDATION RESOURCE MANAGEMENT INC
CENTRAL INDEX KEY: 0001179232
IRS NUMBER: 710714016
STATE OF INCORPORATION: AR
FISCAL YEAR END: 1231
FILING VALUES:
FORM TYPE: 13F-HR
SEC ACT: 1934 Act
SEC FILE NUMBER: 028-10317
FILM NUMBER: 07807289
BUSINESS ADDRESS:
STREET 1: 401 W CAPITOL AVE
STREET 2: SUITE 503
CITY: LITTLE ROCK
STATE: AR
ZIP: 72201
BUSINESS PHONE: 5016043190
MAIL ADDRESS:
STREET 1: 401 W CAPITOL AVE
STREET 2: SUITE 503
CITY: LITTLE ROCK
STATE: AR
ZIP: 72201
</SEC-HEADER>
<DOCUMENT>
<TYPE>13F-HR
<SEQUENCE>1
<FILENAME>form13f_033107.t
xt
<DESCRIPTION>QTR ENDED 03/31/2007
<TEXT>
UNITED STATES
SECURITIES AND EXCHANGE COMMISSION
Washington, D.C. 20549
Form 13F
FORM 13F COVER PAGE
Report for the Calendar Year or Quarter Ended: Mar. 31, 2007
Check here if Amendment [ ]; Amendment Number:
This Amendment (Check only one.): [ ]is a restatement.
[ ]add new holdings entries.
Institutional Investment Manager Filing this Report:
Name: Foundation Resource Management, Inc.
Address: 401 W. Capitol Ave., Suite 503
Little Rock, AR 72201
Form 13F File Number: 28-10317
The institutional investment manager filing this report and the
person by whom it is signed hereby represent that the person
signing the report is authorized to submit it, that all
information contained herein is true, correct and complete, and
that it is understood that all required items, statements,
schedules, lists, and tables, are considered integral parts of
this submission.
Person Signing this Report on Behalf of Reporting Manager:
Name: Judy McNeese
Title: Portfolio Accounting Manager
Phone: 501-604-3190
Signature, Place, and Date of Signing:
/s/ Judy McNeese Little Rock, AR May 01, 2007
[Signature] [City, State] [Date]
Report Type (Check only one.):
[x] 13F HOLDINGS REPORT.
[ ] 13F NOTICE.
[ ] 13F COMBINATION REPORT.
List of Other Managers Reporting for the Manager:
None
<PAGE>
FORM 13F SUMMARY PAGE
Report Summary:
Number of Other Included Managers: 0
Form 13F Information Table Entry Total: 64
Form 13F Information Table Value Total: $382,977
List of Other Included Managers:
None
<PAGE>
<TABLE> <C> <C>
FORM 13F INFORMATION TABLE
VALUE SHARES/ SH/ PUTINVSTMTOTHER VOTING AUTHORITY
NAME OF ISSUER TITLE OF CLASS CUSIP (X$1000) PRN AMT PRN CALDSCRETNMANAGE SOLE SHARED NONE
ACE LTD ORD SHS ORD G0070k103 2348 41154SH SOLE 39952 0 1202
ALAMO GROUP COM 011311107 892 38425SH SOLE 34925 0 3500
ALCOA, INC. COM 013817101 11223 331071SH SOLE 326691 0 4380
AMERICAN NATL INS CO COM 028591105 281 2200SH SOLE 2200 0 0
AT&T INC COM
#!/usr/bin/perl
use strict;
use warnings;
my $Folder ="C:/PerlScripts/SECFolder
";
opendir FOLDER,"$Folder";
my @InFiles =grep !/^\.\.?$/, "C:/PerlScripts/SECFolder/
".+readdir
FOLDER;
closedir FOLDER;
foreach my $listitem ( @InFiles )
{
print "$listitem\n";
}
my $outFile = "I:/SECDocs/holdingsout.tx
t";
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+STR
EET 2:\s+(.+?)$/sm;
my($CompanyCity) = $Data =~ /\s+BUSINESS ADDRESS:\s+STREET 1:\s+$CompanyStreet1\s+STR
EET 2:\s+$CompanyStreet2\s+CIT
Y:\s+(.+?)
$/sm;
my($CompanyState) = $Data =~ /\s+BUSINESS ADDRESS:\s+STREET 1:\s+$CompanyStreet1\s+STR
EET 2:\s+$CompanyStreet2\s+CIT
Y:\s+$Comp
anyCity\s+
STATE:\s+(
.+?)$/sm;
my($CompanyZip) = $Data =~ /\s+BUSINESS ADDRESS:\s+STREET 1:\s+$CompanyStreet1\s+STR
EET 2:\s+$CompanyStreet2\s+CIT
Y:\s+$Comp
anyCity\s+
STATE:\s+$
CompanySta
te\s+ZIP:\
s+(.+?)$/s
m;
my($CompanyPhone) = $Data =~ /\s+BUSINESS ADDRESS:\s+STREET 1:\s+$CompanyStreet1\s+STR
EET 2:\s+$CompanyStreet2\s+CIT
Y:\s+$Comp
anyCity\s+
STATE:\s+$
CompanySta
te\s+ZIP:\
s+$Company
Zip\s+BUSI
NESS 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=$CompanyConformedNa
me\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=$CompanyPhon
e\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";
}
}
#Perl -w C:\PerlScripts\PerlParserF
orEdgar.pl
Start Free Trial