check this out, works great if yoru extracting files referenced by the header ;)
my $fileLocation = ''; my $fileSize = ''; my $fileName = ''; my $chunk = ''; #my $entry_Count = seek and read the count inside the file; $entry_Count =~ s/(.)/sprintf("%02x",ord($1))/egs; #print "There are $entry_Count entries in this file"; seek( $infile, 0x10, 0 ) || die "cannot seek file: $!"; for ( my $i = 1 ; $i <= $entry_Count ; $i++ ) { read( $infile, $fileLocation, 0x08 ); read( $infile, $fileSize, 0x08 ); read( $infile, $fileName, 0x20 ); $fileLocation =~ s/(.)/sprintf("%02x",ord($1))/egs; $fileSize =~ s/(.)/sprintf("%02x",ord($1))/egs; $fileName =~ s/\0+$//; print ("Found $fileName"); open( my $file, '>', "extracted/$fileName" ) || die "Cannot op +en $fileName $!"; binmode($file); seek( $infile, hex($fileLocation), 0 ); read( $infile, $chunk, hex($fileSize) ); syswrite( $file, $chunk ); #print ($file $chunk); close($file); } print "Files/Data extracted";
the above will read a file in, and depending on an entry count (if one is defined in the file you are using) will extract the data that the header references. with the header being $entry_Count long ofcourse

In reply to Re^2: read CSV file line by line and create hash table by james28909
in thread read CSV file line by line and create hash table by lshokri02

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.