Hi
I have since 1999 downloaded statistics in XML format from a home page and now they have changed to JSON. I can't write code myself and wondering if anyone can help me with VBA code that can pick out details from this file and print the details in a text file.
I keep my fingers crossed that any helpful person can help me.
The JSON file looks like this.
{"error":null,"requestInfo":{"elapsedTime":3,"apiVersion":1},"requestId":"d3798818-2b94-4629-8897-efc9490449da","sessionId":null,"deviceId":"fe1c3020-ee04-4225-8a5a-f76c64a806a1","session":null,"sessionUser":null,"clientInfo":null,"result":{"cancelled":false,"events":[{"eventNumber":1,"description":"Nederländerna-Tyskland","cancelled":false,"outcome":"1","outcomeScore":"3-0"},{"eventNumber":2,"description":"Irland-Danmark","cancelled":false,"outcome":"X","outcomeScore":"0-0"},{"eventNumber":3,"description":"Norge-Slovenien","cancelled":false,"outcome":"1","outcomeScore":"1-0"},{"eventNumber":4,"description":"Bulgarien-Cypern","cancelled":false,"outcome":"1","outcomeScore":"2-1"},{"eventNumber":5,"description":"Georgien-Andorra","cancelled":false,"outcome":"1","outcomeScore":"3-0"},{"eventNumber":6,"description":"Lettland-Kazakstan","cancelled":false,"outcome":"X","outcomeScore":"1-1"},{"eventNumber":7,"description":"Armenien-Gibraltar","cancelled":false,"outcome":"2","outcomeScore":"0-1"},{"eventNumber":8,"description":"FYR Makedonien-Liechtenstein","cancelled":false,"outcome":"1","outcomeScore":"4-1"},{"eventNumber":9,"description":"Burton Albion-Bristol R","cancelled":false,"outcome":"1","outcomeScore":"1-0"},{"eventNumber":10,"description":"Coventry-Wycombe","cancelled":false,"outcome":"1","outcomeScore":"1-0"},{"eventNumber":11,"description":"Rochdale-Doncaster","cancelled":false,"outcome":"2","outcomeScore":"2-3"},{"eventNumber":12,"description":"S****horpe-Peterborough","cancelled":false,"outcome":"2","outcomeScore":"0-2"},{"eventNumber":13,"description":"Sunderland-Blackpool","cancelled":true,"outcome":"1","outcomeScore":"0-0"}],"distribution":[{"winners":42,"amount":"107698,00","name":"13 rätt"},{"winners":5112,"amount":"331,00","name":"12 rätt"},{"winners":71519,"amount":"18,00","name":"11 rätt"},{"winners":423006,"amount":"0,00","name":"10 rätt"}],"productName":"Stryktipset","productId":1,"drawNumber":4567,"openTime":"2018-10-07T07:00:00+02:00","closeTime":"2018-10-13T15:59:00+02:00","turnover":"17397460,00","checksum":"9beedfd1ec7e3910c1d852008f911fc75c45ce04"}}
The details I would like to have printed in the text file looks like this.
Stryktipset
1
4567
2018-10-13
1,Nederländerna,Tyskland,false,1,3-0
2,Irland,Danmark,false,X,0-0
3,Norge,Slovenien,false,1,1-0
4,Bulgarien,Cypern,false,1,2-1
5,Georgien,Andorra,false,1,3-0
6,Lettland,Kazakstan,false,X,1-1
7,Armenien,Gibraltar,false,2,0-1
8,FYR Makedonien,Liechtenstein,false,1,4-1
9,Burton Albion,Bristol R,false,1,1-0
10,Coventry,Wycombe,false,1,1-0
11,Rochdale,Doncaster,false,2,2-3
12,S****horpe,Peterborough,false,2,0-2
13,Sunderland,Blackpool,true,1,0-0
13 rätt,42,107698
12 rätt,5112,331
11 rätt,71519,18
10 rätt,423006,0
/Bilbon
I have since 1999 downloaded statistics in XML format from a home page and now they have changed to JSON. I can't write code myself and wondering if anyone can help me with VBA code that can pick out details from this file and print the details in a text file.
I keep my fingers crossed that any helpful person can help me.
The JSON file looks like this.
{"error":null,"requestInfo":{"elapsedTime":3,"apiVersion":1},"requestId":"d3798818-2b94-4629-8897-efc9490449da","sessionId":null,"deviceId":"fe1c3020-ee04-4225-8a5a-f76c64a806a1","session":null,"sessionUser":null,"clientInfo":null,"result":{"cancelled":false,"events":[{"eventNumber":1,"description":"Nederländerna-Tyskland","cancelled":false,"outcome":"1","outcomeScore":"3-0"},{"eventNumber":2,"description":"Irland-Danmark","cancelled":false,"outcome":"X","outcomeScore":"0-0"},{"eventNumber":3,"description":"Norge-Slovenien","cancelled":false,"outcome":"1","outcomeScore":"1-0"},{"eventNumber":4,"description":"Bulgarien-Cypern","cancelled":false,"outcome":"1","outcomeScore":"2-1"},{"eventNumber":5,"description":"Georgien-Andorra","cancelled":false,"outcome":"1","outcomeScore":"3-0"},{"eventNumber":6,"description":"Lettland-Kazakstan","cancelled":false,"outcome":"X","outcomeScore":"1-1"},{"eventNumber":7,"description":"Armenien-Gibraltar","cancelled":false,"outcome":"2","outcomeScore":"0-1"},{"eventNumber":8,"description":"FYR Makedonien-Liechtenstein","cancelled":false,"outcome":"1","outcomeScore":"4-1"},{"eventNumber":9,"description":"Burton Albion-Bristol R","cancelled":false,"outcome":"1","outcomeScore":"1-0"},{"eventNumber":10,"description":"Coventry-Wycombe","cancelled":false,"outcome":"1","outcomeScore":"1-0"},{"eventNumber":11,"description":"Rochdale-Doncaster","cancelled":false,"outcome":"2","outcomeScore":"2-3"},{"eventNumber":12,"description":"S****horpe-Peterborough","cancelled":false,"outcome":"2","outcomeScore":"0-2"},{"eventNumber":13,"description":"Sunderland-Blackpool","cancelled":true,"outcome":"1","outcomeScore":"0-0"}],"distribution":[{"winners":42,"amount":"107698,00","name":"13 rätt"},{"winners":5112,"amount":"331,00","name":"12 rätt"},{"winners":71519,"amount":"18,00","name":"11 rätt"},{"winners":423006,"amount":"0,00","name":"10 rätt"}],"productName":"Stryktipset","productId":1,"drawNumber":4567,"openTime":"2018-10-07T07:00:00+02:00","closeTime":"2018-10-13T15:59:00+02:00","turnover":"17397460,00","checksum":"9beedfd1ec7e3910c1d852008f911fc75c45ce04"}}
The details I would like to have printed in the text file looks like this.
Stryktipset
1
4567
2018-10-13
1,Nederländerna,Tyskland,false,1,3-0
2,Irland,Danmark,false,X,0-0
3,Norge,Slovenien,false,1,1-0
4,Bulgarien,Cypern,false,1,2-1
5,Georgien,Andorra,false,1,3-0
6,Lettland,Kazakstan,false,X,1-1
7,Armenien,Gibraltar,false,2,0-1
8,FYR Makedonien,Liechtenstein,false,1,4-1
9,Burton Albion,Bristol R,false,1,1-0
10,Coventry,Wycombe,false,1,1-0
11,Rochdale,Doncaster,false,2,2-3
12,S****horpe,Peterborough,false,2,0-2
13,Sunderland,Blackpool,true,1,0-0
13 rätt,42,107698
12 rätt,5112,331
11 rätt,71519,18
10 rätt,423006,0
/Bilbon