On Wednesday, June 24, 2015 at 10:28:21 AM UTC-7, goome wrote: > > Hello > i have a table with integer field. > i populated thhe db from a csv (created from other then me). > it sometimes has empty value for the integers fields. > So when i try to get a list of the records of the table, i got: > type 'exceptions.ValueError'> invalid literal for long() with base 10: '' > > [...] > how to face with empty values? > > I think the simplest choices are probably * preprocessing (for example, runnng the CSV file through sed or awk to replace ',,' with ' ,-9999999,' (or other value you can recognize as "illegal") * customizing the CSV import code to allow an empty field.
/dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.