I deleted the cobbled-together one liner because the copy-n-paste I pulled from stack exchange was incorrect. Here is the quick python to do it right.
```
#!/usr/bin/python3
import sys
f=open("binout.bin",'wb')
for line in sys.stdin.readlines():
try:
val = int(line.split(',')[2],0)
print(val)
f.write(bytes([val]))
except:
pass
f.close()
```