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; }