On 18 November 2015 at 03:51, lucas <[email protected]> wrote:
nice job, any idea how to make it a tab delimited file instead of comma?
> lucas
>
> From the book:
Both export_to_csv_file and import_from_csv_file accept keyword arguments
that tell the csv parser the format to save/load the files:
- delimiter: delimiter to separate values (default ',')
- quotechar: character to use to quote string values (default to double
quotes)
- quoting: quote system (default csv.QUOTE_MINIMAL)
Here is some example usage:
>>> import csv
>>> rows = db(query).select()
>>> rows.export_to_csv_file(open('/tmp/test.txt', 'w'),
delimiter='|',
quotechar='"',
quoting=csv.QUOTE_NONNUMERIC)
Regards
Johann
--
Because experiencing your loyal love is better than life itself,
my lips will praise you. (Psalm 63:3)
--
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.