ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Storing BLOBs in excel files (https://www.excelbanter.com/excel-programming/439391-storing-blobs-excel-files.html)

willem van deursen

Storing BLOBs in excel files
 
Hello group,

(must have been asked before, but I don't seem to find the right google
terms)

Is there a way to store Large Binary Objects in cells? I have a list of
items that I want to associate with documents, such as picture, some
piece of text or HTML. I can not be sure it is text, so I need a way to
store it as binary objects, along with the list of items.

I don't need to be able to manipulate the BLOBs, just store them and
retrieve them.

Any help??

Thanks

Willem

--
Willem van Deursen, The Netherlands

replace _nospam@nospam_ for @ to get a valid email address
www.carthago.nl

Peter T

Storing BLOBs in excel files
 
Even binary files are in effect text and can be stored as text in cells,
but... The main problem is with characters under chr(14) which screw things
up when dumped to cells. Two approaches -

- Open the file as binary, convert each 0-255 'number' to a two digit Hex
string and build the string. The Hex string will be double the length of the
original file, plus a tad.

- Aim to keep as much as possible as 'characters' but convert the
troublesome ones below 14 (eg add 32 keeping a record of which characters
will later need to be reconverted with -32). This means the overall size
will not be much larger than the original file size (bit more work though)

With both approaches the resulting strings will need to be split into chunks
of 32k or less (if applicable) to fit into cells, again a bit more in the
way of record keeping.

Regards,
Peter T



"willem van deursen" wrote in message
...
Hello group,

(must have been asked before, but I don't seem to find the right google
terms)

Is there a way to store Large Binary Objects in cells? I have a list of
items that I want to associate with documents, such as picture, some piece
of text or HTML. I can not be sure it is text, so I need a way to store it
as binary objects, along with the list of items.

I don't need to be able to manipulate the BLOBs, just store them and
retrieve them.

Any help??

Thanks

Willem

--
Willem van Deursen, The Netherlands

replace _nospam@nospam_ for @ to get a valid email address
www.carthago.nl




willem van deursen

Storing BLOBs in excel files
 
Thanks Peter, that seems to be the way to go. It does involve some pre-
and postprocessing, and I was hoping to avoid that!

Willem

Peter T wrote:
Even binary files are in effect text and can be stored as text in cells,
but... The main problem is with characters under chr(14) which screw things
up when dumped to cells. Two approaches -

- Open the file as binary, convert each 0-255 'number' to a two digit Hex
string and build the string. The Hex string will be double the length of the
original file, plus a tad.

- Aim to keep as much as possible as 'characters' but convert the
troublesome ones below 14 (eg add 32 keeping a record of which characters
will later need to be reconverted with -32). This means the overall size
will not be much larger than the original file size (bit more work though)

With both approaches the resulting strings will need to be split into chunks
of 32k or less (if applicable) to fit into cells, again a bit more in the
way of record keeping.

Regards,
Peter T



"willem van deursen" wrote in message
...
Hello group,

(must have been asked before, but I don't seem to find the right google
terms)

Is there a way to store Large Binary Objects in cells? I have a list of
items that I want to associate with documents, such as picture, some piece
of text or HTML. I can not be sure it is text, so I need a way to store it
as binary objects, along with the list of items.

I don't need to be able to manipulate the BLOBs, just store them and
retrieve them.

Any help??

Thanks

Willem

--
Willem van Deursen, The Netherlands

replace _nospam@nospam_ for @ to get a valid email address
www.carthago.nl





--
Willem van Deursen, The Netherlands

replace _nospam@nospam_ for @ to get a valid email address
www.carthago.nl


All times are GMT +1. The time now is 01:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com