SQLFROM.factory csv file upload and manipulation

58 views
Skip to first unread message

Yebach

unread,
May 7, 2018, 9:34:59 AM5/7/18
to web2py-users
Hello

I am trying different approaches to upload and manipulate csv file before insert it into DB
I do not need to save the file but If I can open it with csv DictReader that would be awesome.

Any suggestions on how to  achieve it. 

I am trying with SQLFORM.factory

uploadCanonForm=SQLFORM.factory(Field('fileCanon', 'upload',uploadfolder=os.path.join(request.folder,'uploads')),
table_name='canonUpload')

I know how to get the file content but it is stored in a list. Any better way to manipulate it since I also have to skip some lines of the file 

Any suggestions?

Thank you



Reply all
Reply to author
Forward
0 new messages