Hi,
I'm using the last web2py release on localhost with python-2.5.4 on a
LFS based system.
I'm trying to import a CSV file through the web2py interface, I have
tried several CVS output,but everytime,I've got the same error which
is "unable to parse csv file"
Here is the sqlite database created with web2py :
db.py :
<code>
#!/usr/bin/python
# -*- coding: utf-8 -*-
db = SQLDB('sqlite://bddpackages.db')
db.define_table("packages",
SQLField("nom","string",length=32,notnull=True,default=""),
SQLField
("description","string",length=128,notnull=True,default=""),
SQLField("url","string",length=64,notnull=True,default=""),
SQLField("packager","string",length=64,default=""),
SQLField("categorie","string",length=32,default=""))
</code>
Here is the CSV file that I have made (a package database), it's the
output of (prt-get is a package manager) :
<code>
$ prt-get printf "\"\",\"%n\",\"%d\",\"%u\",\"%P\",\"cat\"\n" >> /tmp/
db_packages.csv
</code>
Yes, the first line of this file is written by myself (I saw that line
when I have exported a little database made by hand)
<code>
packages.id,packages.nom,packages.description,packages.url,packages.packager,packages.categorie
"","AfterStep","Gestionnaire de fenêtres","http://
www.afterstep.org/","geanbrun","cat"
"","ICU","International Components for Unicode for C","
http://www.icu-
project.org/","","cat"
"","LibVNCServer","seveur VNC","http://
libvncserver.sourceforge.net/","floreal.c at orange dot fr","cat"
"","MesaLib","OpenGL compatible 3-D graphics library","http://
mesa3d.sourceforge.net","Thierry Nuttens, thierryn1 at hispeed dot
ch","cat"
"","Mowitz","Librairie pour siag","
http://siag.nu/","","cat"
...
...
...
</code>
> 1100 lines
Maybe because the first ""(
packages.id) is empty instead of being
"1","2","3","4"... but don't see how to do this automatically.
I will be very pleased if someone have a clue.
Thanks.
++ fredg