Storing ascii and binary data with a single tab delimited file

I got into a situation where it would be useful to store both ascii and binary data in a tab delimited file. My initial attempts were terrifying. Is it even worth the chase? Any advice? I will need to easily parse the resulting tab delimited file. Downstream, this data goes to MySQLdb. And it would be nice to have binary data stored in db.

+3
source share
4 answers

base64 encodes your binary data. Maybe it's a base64 prefix: or something if that helps. Then it is just an ASCII file, and you can easily parse it as such.

+7
source

?

, .

0

, hex-blob ? , , MySQL.

0

, , . . , .

:

ASCII 1 ASCII 2 BinaryLength Blob
this    is horrible 18  ®##]-û¢?#ý¯#d       ­ú2
please  don't   48  Þ­¾ï¥Zߨ}è¨Ùب©×ÚX©©x©†Ú…zŠWG©j ‡­˜zǘǰ˜y|‰}—

Base64.

0

Source: https://habr.com/ru/post/1706602/


All Articles