Ciao Ernesto,

First of all, please send these of requests to the PyTables list.  It is not 
only that more people can help you, but also that the answers can enlighten 
others too ;-)

A Thursday 10 December 2009 14:53:43 escriguéreu:
> Dear Francesc Alted,
> 
> thank you very much for your wonderful package. I'm using pytables to
> store a lot of biological data. However, I have a question since I
> don't how to go on. In practice, I read an input file and line by line
> I extract a character. Such character should be added to a previous
> one just allocated in a table. If I define a sting I have to define
> also the size and thus the number of characters. However I don't known
> a priori the length of the string. Is there a way to increase
> dinamically the length of a string during the storing?
> Plaase let me known if you need more details and I could provide you
> an example.

Briefly, you have two options here:

1) Declare a field in your table that is 'wide enough' to fit your maximum 
string length.  Then, use compression so as to reduce to unused bytes in 
strings to their minimum expression.  This is the simplest approach.

2) If your maximum string length is *very* large (I mean 1024 bytes or more), 
then I recommend you to use a separate VLArray (with a StringAtom data type) 
to keep this information.  As rows in Table and VLArray objects are ordered, 
the relationship between both is straightforward.

Hope this helps,

-- 
Francesc Alted

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to