I have had limited success with using this package but do need some help.

Here is my problem:
   I have a directory containing thousands of .zip files, each with a
   single text file.
   The archive files have the name in the format IMBFILEnnnn.zip, where
   nnnn is a sequence number.
   The each text file in the archive file has the same name
   "requestString". The text file is XML

Here is a snippet of the code the creates the archive file by extracting a
blob from an Oracle database (this part works)

while (@row = $sth->fetchrow_array)
{
      if (defined $row[1]) {
            $filename = "request_response/\IMBFILE" . $row[0] . ".zip";
            open IMB,">$filename";
            binmode IMB;
            print IMB $row[1];
            $imbcount++;
      }

      if (defined $row[2]) {
            $filename = "request_response/\RMBFILE" . $row[0] . ".zip";
            open RMB,">$filename";
            binmode RMB;
            print RMB $row[2];
            $rmbcount++;
      }
}

What I want to do is extract the text file from each archive, rename it and
write to the same request_response directory. An example would be:

IMBFILE12345.zip (containing requestString) would become request12345.xml

Any ideas?

Regards,


DENNIS M. GRAY
Department of Immigration and Multicultural and Indigenous Affairs



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to