perl -ne "print unpack("B*", $_)" input_file > output_file