Advertisement

05.03.2007 at 10:59AM PDT, ID: 22551066
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.8

Perl reading all files from folder,  Reading data table from.txt file

Asked by mcgilljd in Perl Programming Language

Tags: , , ,

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\PerlParserForEdgar.pl
C:/PerlScripts/SECFolder/.
could not open C:/PerlScripts/SECFolder/.: Permission denied


C:\>Perl -w C:\PerlScripts\PerlParserForEdgar.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.gov
Originator-Key-Asymmetric:
 MFgwCgYEVQgBAQICAf8DSgAwRwJAW2sNKK9AVtBzYZmr6aGjlWyK3XmZv3dTINen
 TWSM7vrzLADbmYQaionwg5sDW3P6oaM5D3tdezXMm7z1T+B+twIDAQAB
MIC-Info: RSA-MD5,RSA,
 N4spgAMfNBKaa7Uzv3hbPZEJhY40vr8D9RWHipvLD6dYRkIbOKzlLSDvO3Wd+7Rg
 MXVvtj2tdzSaT/3BbtXcoA==

<SEC-DOCUMENT>0001179232-07-000006.txt : 20070501
<SEC-HEADER>0001179232-07-000006.hdr.sgml : 20070501
<ACCEPTANCE-DATETIME>20070501172730
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.txt
<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.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";
      }
}

#Perl -w C:\PerlScripts\PerlParserForEdgar.plStart Free Trial
[+][-]05.03.2007 at 11:38AM PDT, ID: 19025679

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Tags: perl, folder, files, read
Sign Up Now!
Solution Provided By: ozo
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.03.2007 at 11:54AM PDT, ID: 19025802

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.03.2007 at 11:56AM PDT, ID: 19025817

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.03.2007 at 12:03PM PDT, ID: 19025862

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32