A Friday 19 February 2010 09:44:35 Peter Buchmann escrigué:
> hi,
> 
> I'm new to pytables and seem to be missing something:
> 
> I need in a table a column for a text: the thing is I don't know how
> long such text entry will be.
> 
> 
> I thought to use:  tables.StringCol   but it seems I have to define a
> max text length.
> 
> Question: what would be the correct way to have a string column - but
> where I can insert any text length .

The usual way of doing that in pytables is to use a maximum length in 
tables.StringCol and then put your (shorter) strings in this field.  Then, you 
can use compression to minimize the impact of this in your app.

If you cannot predict the maximum size of your strings, you can use VLArray 
objects and pointers to them.  This discussion may shed more light on this:

http://sourceforge.net/mailarchive/forum.php?thread_name=200912151909.18441.faltet%40pytables.org&forum_name=pytables-
users

In particular, you may want to use a hybrid approach, as explained in:

http://sourceforge.net/mailarchive/message.php?msg_name=200912141425.48675.faltet%40pytables.org

Hope this helps,

-- 
Francesc Alted

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to