Hi, Sorry. Here's the code:
my $filename = "Words.txt"; open(my $fh, '<', $filename) or die "Could not open file '$filename' $ +!"; binmode $fh; my $data = <$fh>; $data =~ s/\x00/\ /gi; close $fh; my $length = length($data); my $count = 0; for(my $i=0;$i < $length/36;$i++){ my $name = substr($data,$i*36,28); my $book = ord(substr($data,$i*36 + 28,1)) + 1; my $v1 = ord(substr($data,$i*36 + 29,1)) + 1; my $v2 = ord(substr($data,$i*36 + 30,1)) + 1; print $name . " - " . "$book\:$v1\:$v2\n"; $count += 1; }
Stops after 38 records - it should go up to some thousands... The lenght says its about only 1300 characters - it should be also some thousands... Regards, Kepler

In reply to Re^2: Perl binary file reading by kepler
in thread Perl binary file reading by kepler

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.