First things first, I've looked around and found this:
In python, how to convert a hex ascii string to raw internal binary string?
https://docs.python.org/3/library/base64.html
Which is nice, but seems to involve converting hexadecimal to a binary representation. And base64 doesn't seem to support what I want, or am I being silly?
What I have is code from Matlab that outputs data in the form of 16 bit signed binary. But it should be saved as a raw binary, and not .m. So I've pushed it to a .txt file. And thus it lives its life as ASCII, which is nice and all but I need it as a pure .bin.
I've tried being lazy about this and searched for tools to simply let me copy and paste my data over to a dummyfile. But for whatever reason I've failed that.
So fine fine, I could write a python code that opens up the data and chunks the data into 16bit blocks some logic code and write it as it's ACII implementation, then do a (https://docs.python.org/2/library/binascii.html) conversion and write to the file?
This seems horribly cludgy (probably because it is). How can I get about this in a more elegant, or more preferably, lazy manner?
===
Short version: I have data like 0000111001000011 (signed 16) in ASCII encoding, I want that to be 0000111001000011 in raw bin. Me dumb, need help.