Home › Forums › kdb+ › How to download attachments from *.eml file › Re: How to download attachments from *.eml file
-
Kdb+ can parse binary files as nicely shown at the recent KX meetup by
https://community.kx.com/t5/Events/KX-Community-Meetup-New-York/ba-p/13880
File formats can get complicated though so this can be a lot of work.
If I wanted to do this task quickly I would either:
a) Use a system call to a command line tool to extract the files on disk and then read them in from there.
Writing them to current directory or using mktemp command to write in /var/tmp
b) Wrap some exiting python code using EmbedPy to extract the email and attachments to JSON and read in to kdb+ this way.
Similar to how I did for XML with https://github.com/rianoc/qXML
Some discussions on the topic in Python world:
(Note: I have not tested these for functionality or safety)