Thanks Leonel

No it don't.

>However, this is not necessary as you can send the delimiter to
import_from_csv_file. So this may be enough:
>db.products.import_from_csv_file(request.vars.csvfile.file, delimiter=';')

Great but I need to replace other characters.

----------------------
Gael Princivalle

2014-10-03 16:45 GMT+02:00 Leonel Câmara <[email protected]>:

> Does this work?
>
> csvtxt = request.vars.csvfile.file.read()
> csvtxt = csvtxt.replace(';', ',')
> from cStringIO import StringIO
> db.products.import_from_csv_file(StringIO(csvtxt))
>
> However, this is not necessary as you can send the delimiter to
> import_from_csv_file. So this may be enough:
>
> db.products.import_from_csv_file(request.vars.csvfile.file, delimiter=';')
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/rDIOmGTxSRs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to