franxic Posted August 6, 2015 Share Posted August 6, 2015 Hi there,I want to evaluate a json-array that is stored inside a xml-file, e.g.:<club>Real Madrid</club><json_members>{members:[{member_name:sergio,member_since:2010},{member_name:alonso,member_since:2007}]}</json_members>I need to do that this way because the internet gateway our company uses does not support filling the database with an unknown number of datafields.Any help is appreciated.Regards, Frank Link to comment Share on other sites More sharing options...
calculate.machine Posted September 6, 2015 Share Posted September 6, 2015 The algorithm is this: retrieve the substring beginning with "members" from xml, take it as JSON data and parse it as a two-dimensional table. It is complicated to write a report script to code this. An alternative is to first parse JSON using esProc import@j() function and then use the report to access the esProc code via JDBC. Below is the code:A1=file("d:\source.txt").read()A2=pos(A1,"{members")A3=pos(A1,"</json_members>")A4=mid(A1,A2,A3-A2)A5=A4.import@j().members You can find more examples in http://blog.raqsoft.com/?p=4679 . Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now