upload csv file

Moderator: areski

upload csv file

Postby deficit » Wed Jun 12, 2013 11:26 pm

getting the following error when uploading a csv file. in newfies-django.log have tried the example file listed at
https://github.com/Star2Billing/newfies ... act_10.txt and still get same error any ideas?

This is a stock 2.5.2 install.

ERROR 2013-06-12 16:19:36,716 base 1438 140407545964288 Internal Server Error: /contact/import/
Traceback (most recent call last):
File "/usr/share/virtualenvs/newfies-dialer/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/usr/share/virtualenvs/newfies-dialer/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 25, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/usr/share/newfies/dialer_contact/views.py", line 569, in contact_import
if not int(row[5]):
IndexError: list index out of range


Thanks
deficit
 
Posts: 3
Joined: Wed Jun 12, 2013 11:22 pm

Re: upload csv file

Postby deficit » Thu Jun 13, 2013 3:16 am

Well my own fix... Not really a problem with the system but more with the way of how it uploads.. First figured out the | as clearly stated in documentation was getting messed up with my csv editor. After which I was getting JSON errors well that was an easy fix don't follow the example on the import file page.

Follow the one right below it
Upload CSV file using the pipe "|" as the field delimiter, e.g. 1234567890|surname|forename|email@somewhere.com|test-contact|1|address|city|state|US|unit|{"age":"32","title":"doctor"}|

Make sure your additional variable are in JSON format.
deficit
 
Posts: 3
Joined: Wed Jun 12, 2013 11:22 pm

Re: upload csv file

Postby Neurotec » Tue Jul 16, 2013 5:25 am

We were having a lot of trouble with uploading CSV files.

As we only need phone numbers I came up with a real easy way to load the data.

For example;

0299669911|||||1|||||||:
0299669922|||||1|||||||:
etc etc

Obviously the phone number is first, followed by the | which represents a non applicable field (such as Address) followed by the 1 which represents an active contact number. The : represents the end of data field.

Hope this helps.
Neurotec
 
Posts: 8
Joined: Mon May 27, 2013 12:40 am


Return to Installation

Who is online

Users browsing this forum: No registered users and 15 guests

cron