#!/usr/bin/perl # Script to extract "item 7" from a 10-K report. # This will write the "good" part of the file to stdout, and will write # a "schema string" on a single line to stderr. $dirtoget="E:\######"; $dirwrite="E:\#####"; opendir(IMD, $dirtoget) || die("Cannot open directory"); @thefiles= readdir(IMD); closedir(IMD); foreach $f (@thefiles) { unless ( ($f eq ".") || ($f eq "..") ) { $fr="$dirtoget$f"; open(FILEREAD, "< $fr"); $f=~s/.txt/.mda/g; $fw="$dirwrite$f"; #print $f1; open(FILEWRITE, "> $fw"); $x=""; while($line = ) { $x .= $line; } # read the whole file into one string close FILEREAD;