in reply to Re^9: Bit handling in Perl
in thread Bit handling in Perl
1. The code that I wrote is as follows.
#! usr/bin/perl #convert csv to binary use strict; use warnings; open(A,"k.csv") or die "File not found\n"; open(B,">m.fp"); binmode B; while(<A>) { if($_=~m/(".*"),(.*)/gi) { my $temp=$2; $temp=~tr[,\n][]d; print B "$1,".pack 'b*',$temp; print B "\n"; } } close(A); close(B); open(C,"m.fp") or die "File not found\n"; open(D,">>k.csv"); binmode C; print D "\n"; while(<C>) { if($_=~m/(".*"),(.*)\n/gi) { print D "$1,"; my $a=$2; my $i; for($i=0;$i<=880;$i++) { print D vec($a,$i,1).","; } print D "\n"; } } close(C); close(D);
2. The test data where first two rows are properly converted to binary and the next two are not.
"Test1",1,1,1,0,0,0,0,0,0,1,1,1,1,0,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,0,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0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0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
I then compared each input row to its output counterpart along each column using Excel formula and found that the last two output rows [row 8,9] are different from their input rows [row 3,4].
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: Bit handling in Perl
by BrowserUk (Patriarch) on Oct 27, 2014 at 14:54 UTC | |
by vaidhy_m (Novice) on Oct 31, 2014 at 09:28 UTC |