I tried to convert my csv file with csv2json.py and it worked before
(see this thread
http://groups.google.com/group/django-users/browse_frm/thread/a00b529ba2147d91/efb82ba2893cc0a7?lnk=gst&q=csv#efb82ba2893cc0a7)
but now I am trying the same exact thing in a different directory and
I get this error:

C:\...\Django\sw2\wkw2>csv2json.py csvtest1.csv wkw2.Lawyer
Converting C:...\Django\sw2\wkw2csvtest1.csv from CSV to JSON as
C:\...\Django\sw2\wkw2csvtest1.csv.json

Traceback (most recent call last):
  File "C:\...\Django\sw2\wkw2\csv2json.py", line 37, in <module>
    f = open(in_file, 'r' )
IOError: [Errno 2] No such file or directory:
'C:\\...\\Django\\sw2\\wkw2csvtest1.csv'

Below is the link to csv2jason.py and line 37:

http://www.djangosnippets.org/snippets/1680/
...
in_file = dirname(__file__) + input_file_name
out_file = dirname(__file__) + input_file_name + ".json"

print "Converting %s from CSV to JSON as %s" % (in_file, out_file)

[line 37] --> f = open(in_file, 'r' )
fo = open(out_file, 'w')

Do you know an easier way to convert csv to json? (Or how to fix
this?)

On Dec 10, 1:27 pm, John M <retireonc...@gmail.com> wrote:
> You could also use OpenOffice with the SQLIte connector (I think)
>
> I use Access in Windows, works great!
>
> But you might try getting the CSV into a JSON format that the
> manage.py loaddata command could use, that set's you up for the future
> too.
>
> J
>
> On Dec 10, 8:57 am, Zeynel <azeyn...@gmail.com> wrote:
>
>
>
> > Can anyone point me in the right place in documentation for populating
> > my sqlite3 tables with the data in the .csv file? Thanks.

--

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


Reply via email to