#! 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() { 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() { 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);