Hi
I am running into weird issues with the csv import/export of the db.
To start I use the following code to check the "dialect" of the csv
files:
import csv
def DisplayDialect(file):
csvfile = open(file)
smple = csvfile.read()
dialect = csv.Sniffer().sniff(smple)
print " Delimiter :" + str(dialect.delimiter)
print " Doublequote : "+ str(dialect.doublequote)
print " Escapechar :" + str(dialect.escapechar)
print " LineTerminator :" + str(dialect.lineterminator)
print " Quotechar :" + str(dialect.quotechar)
print " quoting :" + str(dialect.quoting)
print " skipinitialspace :" + str(dialect.skipinitialspace)
Here is what happens:
CASE A:
- Export the entire db to csv
- The csv.sniffer generates an exception "Could not determine
delimiter"
- However I can import the file back in web2py
CASE B:
- Export the entire db to csv
- Open the excel
- The csv.sniffer can recognize the format
- However I CANNOT import the file back in web2py
Any suggestions here? This makes it impossible for me to add testing
data in excel and import it back into web2py.
Thanks
Miguel
If I export my entire DB and then I try to check the format with
csv.sniffer using the following cod
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.