pytheas has asked for the wisdom of the Perl Monks concerning the following question:
but when i run it it comes out with four columns of something seeming like hexadecimal (0xe15d ...). The dcd files are about 700 mb so i can't upload it for you to see it, but i managed to cut the first 80kb of it with hexedit and i upload it here: http://www.gigasize.com/get.php?d=7qfs5f331bf Does anyone have any idea or some plain guidelines because i really need get it done for my work. Thanks anyway!use warnings; use strict; @ARGV == 2 or die "usage: $0 in_filename out_filename\n"; # get first argument, i.e filename my $in_filename = shift; print "You chose input <$in_filename>\n"; my $out_filename = shift; print "You chose output <$out_filename>\n"; #set infile to binary mode open INFILE, '<:raw', $in_filename or die "can't open $in_filename: $! +"; open OUTFILE, '>', $out_filename or die "can't open $out_filename: $!" +; # read 8 bytes at a time $/ = \8; while ( <INFILE> ) { print OUTFILE join( ', ', map sprintf( '0x%04x', $_ ), unpack 'S*', $_ + ), "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: binary to ascii convertion
by GrandFather (Saint) on Oct 21, 2008 at 10:16 UTC | |
|
Re: binary to ascii convertion
by cdarke (Prior) on Oct 21, 2008 at 12:30 UTC | |
|
Re: binary to ascii convertion
by almut (Canon) on Oct 21, 2008 at 14:26 UTC | |
by pytheas (Initiate) on Oct 21, 2008 at 18:45 UTC | |
|
Re: binary to ascii convertion
by graff (Chancellor) on Oct 21, 2008 at 13:36 UTC | |
|
Re: binary to ascii convertion
by gone2015 (Deacon) on Oct 22, 2008 at 11:09 UTC |