Hello,

I have a php export file that I need to duplicate in django.
I am using django csv import

Here is the PHP format I want.
3128559,"GOODYEAR","4024064","","","","","","","","","","","16","","","","",""

Here is the django output
3128559,'GENERAL','154800000',,,,,,,,,,,'4',,,,

I want it to look like the PHP version.

Here is my brief django code:

with open('D11238135.csv', 'w') as writer:

   line1 = '3128559'
                line2 = "'" + manufacturer + "'"
                line3 = "'" + row.sku + "'"
                line4 = ''
                line5 = ''
                line6 = ''
                line7 = ''
                line8 = ''
                line9 = ''
                line10 = ''
                line11 = ''
                line12 = ''
                line13 = ''
                line14 = "'" + str(row.stock) + "'"
                line15 = ''
                line16 = ''
                line17 = ''
                line18 = ''

            writer.writerow([line1, line2, line3, line4, line5, line6, 
line7, line8, line9, line10, line11,
                             line12, line13, line14, line15, line16, 
line17, line18])

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to