#!/usr/bin/perl -w ###### usage: cat inputfile | abiglobal.pl $i=0; while ($_ = ) { if(/(FUND ACTIVITY REPORT)/ ) { $input=$_; chop($input); $fundcode=substr($input,0,5); $fundcode=~ s/ //g; $input=~ tr/\"//; $input=~ tr/\'//; # $input=~ tr/,/\t/; $input=~s/REPORT,/REPORT /g; $input=~s/ / /g; @in=split(/ /,$input); # @fund=$in[0]; if($i=="0"){ $final=$in[3].".html"; open (OUT,">>body.txt") || die "I am not able to write to file"; open (HEAD,">>head.txt") || die "not able to open temp header"; print HEAD "Fund Activity Report
Fund Activity Reports: $in[3]
$fundcode \n"; $i=99; } print HEAD "$fundcode \n"; print OUT "Fund: $in[0] FundInfo: $in[1] $in[2]
\n"; } else { print OUT "
$_
\n"; } } #### end while stdin print HEAD "


\n"; print OUT "\n"; close OUT; close HEAD; #$outfile=~tr/ /_/; $outfile=~tr/,/_/; print "$outfile\n"; system "cat head.txt body.txt >>/home/fundlist/test/$final"; system "rm head.txt"; system "rm body.txt"; opendir(DIR, "./public_html"); open (OUT,">/home/fundlist/test/index.html") || die "I am not able to write to file"; print OUT ("Fund List Directory\n"); print OUT ("

Directory Listing

\n"); while($file = readdir(DIR) ) { print OUT ("$file
\n"); } print OUT ("\n"); closedir(DIR); close (OUT);