What datatype are you using for the data currently? The python CSV
module can get its data from any sequence, so if you already have all
the info in a list use csv.writer if it's a in a list of dictionary
objects, then use csv.DictWriter. Refer to 
http://docs.python.org/library/csv.html

With more info on your current data structure we may be able to
provide more guidance.


~Brian

On Dec 10, 6:10 am, GhostRider <kenneth.t.lundst...@gmail.com> wrote:
> There is probably nothing wrong with fetch data via SQL, but I have no
> idea how to write that complicated SQL query where getting data from 7
> or 8 tables and as I made the calculations function already for
> viewing I was looking for a way to just send it to a CSV.
>
> I´ll look into the "You can use the python csv module directly: " It
> sounds promising.
>
> Kenneth
>
> On Dec 9, 7:37 pm, Thadeus Burgess <thade...@thadeusb.com> wrote:
>
> > Is there something wrong with the following?
>
> > results = db(db.table.field == searchvar)(db.table.field2 ==
> > searchvar2).select()
>
> > results.export_to_csv(outputfile, delimiter=',', quotechar='"',
> > qouting=csv.QOUTE_MINIMAL, represent=False)
>
> > -Thadeus
>
> > On Wed, Dec 9, 2009 at 7:24 AM, Hernan Olivera <lholiv...@gmail.com> wrote:
> > > 2009/12/9 GhostRider <kenneth.t.lundst...@gmail.com>:
> > >> I think the columns should the separated with a ; and not , to work
> > >> better i Microsofts world.
>
> > > It depends on the system language settings; both are correct, but you
> > > must be carefull about decimal point or comma (i.e.: don't use comma
> > > as separator and decimal point :)
>
> > > --
> > > Hernan Olivera
>
> > > --
>
> > > You received this message because you are subscribed to the Google Groups 
> > > "web2py-users" group.
> > > To post to this group, send email to web...@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > web2py+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/web2py?hl=en.

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to