Answer the question
In order to leave comments, you need to log in
1C unload parser in python?
Good afternoon! Many probably know a system called 1C, and, for sure, many have come across it)
There was a problem - you need to parse the upload with goods from 1C to python, so that you can then load it into the django database. Maybe someone had ready-made solutions? Or is 1C such a universal tool that each upload is unique?
Answer the question
In order to leave comments, you need to log in
Here is the code that helped me rename Russian tags to English:
infile = open('ex.xml')
outfile = open('out.xml', 'w')
replacements = {'Sentence':'mynum', 'Id' :'id',}
for line in infile:
for src, target in replacements.iteritems():
line = line.replace(src, target)
outfile.write(line)
infile.close()
outfile.close()
I unloaded xml from 1C, python replaced tags from Russian to English and parsed as xml.
Perhaps there is a more elegant solution, but time was running out.
I once wrote an export of the entire database from 1C dbf files to MySQL (in python). If this option is suitable, then write in a personal - I will throw off the source code and comment on the code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question