Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Stringified list to list with multiple types of data

I’m trying to use JSON to return this string to a list with each element in its own data. The string is the following

"[3764,1,[[1,[[1,209,[4378872,'Algeria U23','Comoros U21','1.009-E0507220606002',6,'06/06/2022 23:30','',1,0,1,8,{126:[2,2]}],[3,1,21,45,0,0,{310:[0,1,21,45,0,0,,,{1:45,2:45,3:15,4:15},0],307:[0,1,21,45,0,0,,,{1:45,2:45,3:15,4:15},0],312:[0,1,21,45,0,0,,,{1:45,2:45,3:15,4:15},0],311:[0,1,21,45,0,0,,,{1:45,2:45,3:15,4:15},0],309:[0,1,21,45,0,0,,,{1:45,2:45,3:15,4:15},0],308:[0,1,21,45,0,0,,,{1:45,2:45,3:15,4:15},0],306:[0,1,21,45,0,0,,,{1:45,2:45,3:15,4:15},0],330:[0,1,21,45,0,0,,,{1:45,2:45,3:15,4:15},0],313:[0,1,21,45,0,0,,,{1:45,2:45,3:15,4:15},0],331:[0,1,21,45,0,0,,,{1:45,2:45,3:15,4:15},0],126:[1,1,21,45,0,0,,,{1:45,2:45,3:15,4:15},0]},,{1:45,2:45,3:15,4:15},0],[[21,21,[]],[84454170,[1,0,1,1,5000,0.25,20655515],[1.71,2.17]],[84454171,[1,0,1,1,8000,0.50,20655515],[2.07,1.79]],[84454178,[5,0,5,1,2000,0.00,20655515],[1.288,4.168,10.12]],[84882193,[1,0,1,1,3000,0.75,20655515],[2.49,1.53]]],1],[1,102207,[4401312,'Lanus (R)','Rosario Central (R)','1.045-E1673220606002',10,'06/06/2022 22:00','',1,2,1,,{}],[2,2,40,45,0,0,{},,{1:45,2:45,3:15,4:15},0],[[5,5,[]],[85201372,[1,0,1,1,1000,0.00,21038147],[1.60,2.19]],[85201373,[1,0,1,1,500,0.25,21038147],[3.08,1.24]],[85201380,[5,0,5,1,500,0.00,21038147],[46.12,3.40,1.192]]],3],[1,66984,[4377409,'GAIS Goteborg','BK Olympic','1.012-E0692220606001',10,'06/06/2022 23:00','',1,1,1,,{}],[2,5,6,45,0,0,{313:[0,5,6,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],312:[0,5,6,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],311:[0,5,6,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],310:[0,5,6,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],309:[0,5,6,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],308:[0,5,6,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],330:[0,5,6,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],307:[0,5,6,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],306:[0,5,6,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],331:[0,5,6,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0]},'HT',{1:45,2:45,3:15,4:15},0],[[9,9,[]],[84395293,[1,0,1,1,2000,0.25,20626133],[1.64,2.21]],[84395294,[1,0,1,1,3000,0.50,20626133],[1.96,1.86]],[84395301,[5,0,5,1,500,0.00,20626133],[1.94,2.411,4.648]]],1],[1,92035,[4371659,'Cyprus U21','Greece U21','1.010-E0473220606001',10,'06/06/2022 22:30','',1,0,1,16,{126:[1,2]}],[4,2,17,45,0,0,{126:[1,2,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],331:[0,2,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],330:[0,2,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],313:[0,2,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],312:[0,2,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],311:[0,2,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],310:[0,2,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],309:[0,2,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],308:[0,2,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],307:[0,2,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],306:[0,2,17,45,0,0,,,{1:45,2:45,3:15,4:15},0]},,{1:45,2:45,3:15,4:15},0],[[16,16,[]],[84224717,[1,0,1,1,3000,-0.75,20548578],[1.42,2.85]],[84224718,[1,0,1,1,5000,-0.50,20548578],[1.66,2.28]],[84224719,[1,0,1,1,2000,0.00,20548578],[3.63,1.26]],[84224727,[5,0,5,1,2000,0.00,20548578],[1.672,2.843,6.376]],[85277845,[1,0,1,1,10000,-0.25,20548578],[2.11,1.78]]],2],[1,2330,[4389559,'TPS Turku','PK-35 Helsinki','1.011-E0433220606001',10,'06/06/2022 23:30','',0,0,1,12,{}],[3,1,17,45,0,0,{331:[0,1,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],330:[0,1,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],313:[0,1,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],312:[0,1,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],311:[0,1,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],310:[0,1,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],309:[0,1,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],308:[0,1,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],307:[0,1,17,45,0,0,,,{1:45,2:45,3:15,4:15},0],306:[0,1,17,45,0,0,,,{1:45,2:45,3:15,4:15},0]},,{1:45,2:45,3:15,4:15},0],[[17,17,[]],[84784753,[1,0,1,1,2000,1.00,20820481],[2.42,1.56]],[84784754,[1,0,1,1,5000,0.75,20820481],[2.00,1.86]],[84784761,[5,0,5,1,1000,0.00,20820481],[1.72,3.064,4.552]],[85268974,[1,0,1,1,3000,0.50,20820481],[1.73,2.14]]],1],[1,164815,[4376310,'Tajikistan U23','United Arab Emirates U23','1.007-E0302220606002',10,'06/06/2022 23:00','',0,1,1,5,{126:[1,2]}],[4,5,4,45,0,0,{330:[0,5,4,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],313:[0,5,4,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],312:[0,5,4,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],311:[0,5,4,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],310:[0,5,4,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],309:[0,5,4,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],308:[0,5,4,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],307:[0,5,4,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],306:[0,5,4,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],331:[0,5,4,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0],126:[1,5,4,45,0,0,,'HT',{1:45,2:45,3:15,4:15},0]},'HT',{1:45,2:45,3:15,4:15},0],[[15,15,[]],[84874670,[1,0,1,1,12000,-0.75,20609961],[2.04,1.82]],[84874671,[1,0,1,1,3000,-0.50,20609961],[2.31,1.62]],[84874678,[5,0,5,1,3000,0.00,20609961],[44.20,5.416,1.105]],[84874680,[1,0,1,1,2000,-1.25,20609961],[1.42,2.78]],[84880354,[1,0,1,1,5000,-1.00,20609961],[1.62,2.31]]],2],[1,57193,[4401183,'FC Kufstein','SC Imst','1.023-E0909220606001',10,'06/06/2022 23:00','',0,1,0,0,{}],[2,5,2,45,0,0,{},'HT',{1:45,2:45,3:15,4:15},0],[[5,5,[]],[85194258,[1,0,1,1,300,-0.75,21034284],[2.21,1.58]],[85194259,[1,0,1,1,500,-1.00,21034284],[1.86,1.90]],[85196402,[5,0,5,1,500,0.00,21034284],[26.92,5.032,1.096]]],2]],[],[]],[2,[[1,57604,[4392510,'Remo Belem','Campinense','1.042-E1601220606001',10,'06/07/2022 07:00','',0,0,1,,{}],,[[15,15,[]],[84894658,[1,0,1,0,500,0.50,20880013],[1.86,1.94]],[84894663,[5,0,5,0,500,0.00,20880013],[1.835,2.968,3.736]],[85252258,[1,0,1,0,300,0.75,20880013],[2.13,1.68]]],1],[1,58275,[4362462,'Cayman Islands','British Virgin Islands','1.035-E1411220606003',10,'06/07/2022 06:00','',0,0,1,,{}],,[[8,8,[]],[83938448,[1,0,1,0,500,1.00,20423264],[1.91,1.89]],[83938450,[5,0,5,0,500,0.00,20423264],[1.508,3.784,4.648]]],1],[1,58275,[4362464,'Aruba (n)','Saint Martin','1.035-E1411220606004',10,'06/07/2022 07:00','',0,0,1,,{}],,[[8,8,[]],[83938505,[1,0,1,0,500,0.75,20423277],[1.87,1.93]],[83938507,[5,0,5,0,500,0.00,20423277],[1.643,3.304,4.264]]],1],[1,58275,[4362465,'Bonaire (n)','Sint Maarten','1.035-E1411220606001',10,'06/07/2022 04:00','',0,0,1,,{}],,[[8,8,[]],[83938518,[1,0,1,0,500,1.75,20423278],[1.83,1.97]],[83938520,[5,0,5,0,500,0.00,20423278],[1.211,5.224,7.96]]],1],[1,58275,[4362466,'US Virgin Islands','Turks and Caicos Islands','1.035-E1411220606002',10,'06/07/2022 04:00','',0,0,1,,{}],,[[8,8,[]],[83938531,[1,0,1,0,500,0.00,20423279],[1.87,1.93]],[83938533,[5,0,5,0,500,0.00,20423279],[2.42,2.968,2.497]]],3],[1,49228,[4254124,'Andorra','Moldova','1.006-E0086220606002',10,'06/07/2022 02:45','',0,0,1,9,{}],,[[30,30,[]],[80599243,[1,0,1,0,5000,-0.25,18971804],[2.02,1.84]],[80599248,[5,0,5,0,2000,0.00,18971804],[3.256,2.92,2.094]],[85133648,[1,0,1,0,3000,-0.50,18971804],[1.75,2.12]],[85217314,[1,0,1,0,2000,-0.75,18971804],[1.53,2.49]],[85269899,[1,0,1,0,1000,0.00,18971804],[2.72,1.44]]],2],[1,49228,[4254125,'Latvia','Liechtenstein','1.006-E0086220606001',6,'06/06/2022 23:59','',0,0,1,3,{}],,[[27,27,[]],[80599256,[1,0,1,0,2000,1.75,18971805],[1.48,2.61]],[80599261,[5,0,5,0,3000,0.00,18971805],[1.115,7.96,11.56]],[85133646,[1,0,1,0,8000,2.25,18971805],[1.93,1.93]],[85217312,[1,0,1,0,3000,2.00,18971805],[1.63,2.29]],[85269895,[1,0,1,0,5000,2.50,18971805],[2.21,1.68]]],1],[1,49227,[4254116,'Slovakia','Kazakhstan','1.005-E0084220606001',6,'06/07/2022 02:45','',0,0,1,7,{}],,[[27,27,[]],[80598384,[1,0,1,0,8000,1.50,18971408],[1.98,1.90]],[80598389,[5,0,5,0,3000,0.00,18971408],[1.297,3.976,13.48]],[84959730,[1,0,1,0,3000,1.75,18971408],[2.31,1.64]],[85217220,[1,0,1,0,5000,1.25,18971408],[1.70,2.21]],[85269887,[1,0,1,0,2000,1.00,18971408],[1.46,2.72]]],1],[1,49227,[4254117,'Belarus (n)','Azerbaijan','1.005-E0084220606002',10,'06/07/2022 02:45','',0,0,1,6,{}],,[[30,30,[]],[80598397,[1,0,1,0,8000,0.00,18971409],[2.01,1.87]],[80598402,[5,0,5,0,3000,0.00,18971409],[2.737,2.795,2.593]],[85134427,[1,0,1,0,3000,0.25,18971409],[2.40,1.59]],[85217226,[1,0,1,0,5000,-0.25,18971409],[1.71,2.20]],[85269891,[1,0,1,0,2000,-0.50,18971409],[1.50,2.61]]],3],[1,49225,[4254051,'Austria','Denmark','1.003-E0052220606001',6,'06/07/2022 02:45','',0,0,1,2,{}],,[[46,46,[]],[80589858,[1,0,1,0,10000,-0.25,18966442],[1.77,2.12]],[80589863,[5,0,5,0,5000,0.00,18966442],[2.814,3.16,2.401]],[84959476,[1,0,1,0,20000,0.00,18966442],[2.09,1.79]],[85133986,[1,0,1,0,3000,0.25,18966442],[2.42,1.58]],[85134002,[1,0,1,0,5000,-0.50,18966442],[1.58,2.42]]],3],[1,49225,[4254052,'Croatia','France','1.003-E0052220606002',6,'06/07/2022 02:45','',0,0,1,1,{}],,[[46,46,[]],[80589871,[1,0,1,0,20000,-0.50,18966443],[1.87,2.01]],[80589876,[5,0,5,0,5000,0.00,18966443],[3.40,3.496,1.979]],[84959478,[1,0,1,0,10000,-0.25,18966443],[2.16,1.74]],[85133988,[1,0,1,0,5000,-0.75,18966443],[1.66,2.28]],[85134004,[1,0,1,0,3000,0.00,18966443],[2.69,1.47]]],2],[1,38416,[4373988,'Harbour View FC','Montego Bay United','1.037-E1501220606002',10,'06/07/2022 08:30','',0,0,1,,{}],,[[13,13,[]],[84300720,[1,0,1,0,500,1.00,20583002],[1.89,1.87]],[84300725,[5,0,5,0,500,0.00,20583002],[1.48,3.64,4.744]]],1],[1,38416,[4385938,'Waterhouse FC','Vere United FC','1.037-E1501220606001',10,'06/07/2022 06:00','',0,0,1,,{}],,[[13,13,[]],[84679092,[1,0,1,0,500,1.00,20762220],[1.82,1.94]],[84679097,[5,0,5,0,500,0.00,20762220],[1.451,3.688,5.032]]],1],[1,63464,[4386019,'Leones FC','Boyaca Chico','1.038-E1538220606001',10,'06/07/2022 04:00','',0,0,1,,{}],,[[15,15,[]],[84687717,[1,0,1,0,1000,0.25,20768975],[1.96,1.84]],[84687721,[5,0,5,0,500,0.00,20768975],[2.075,2.92,3.064]],[85251911,[1,0,1,0,500,0.00,20768975],[1.56,2.31]]],1],[1,9722,[4391896,'JJ Urquiza','Villa San Carlos','1.040-E1489220606001',10,'06/07/2022 02:30','',0,0,1,,{}],,[[13,13,[]],[84856642,[1,0,1,0,500,-0.25,20858738],[1.70,2.11]],[84856646,[5,0,5,0,500,0.00,20858738],[2.651,2.785,2.42]]],2],[1,63464,[4386020,'Llaneros FC','Real Cartagena','1.038-E1538220606002',10,'06/07/2022 04:00','',0,0,1,,{}],,[[15,15,[]],[84687730,[1,0,1,0,1000,0.75,20768976],[1.70,2.11]],[84687734,[5,0,5,0,500,0.00,20768976],[1.518,3.64,4.84]],[85251899,[1,0,1,0,500,1.00,20768976],[1.98,1.82]]],1],[1,4892,[4389537,'Deportivo Riestra','Deportivo Madryn','1.036-E1487220606001',10,'06/07/2022 02:30','',0,0,1,,{}],,[[15,15,[]],[84784094,[1,0,1,0,1000,0.25,20820365],[2.04,1.76]],[84784098,[5,0,5,0,500,0.00,20820365],[2.257,2.689,2.968]],[85240202,[1,0,1,0,500,0.00,20820365],[1.64,2.19]]],1],[1,4892,[4389538,'Villa Dalmine','CA Temperley','1.036-E1487220606002',10,'06/07/2022 05:10','',0,0,1,,{}],,[[15,15,[]],[84784107,[1,0,1,0,1000,0.25,20820366],[2.01,1.79]],[84784111,[5,0,5,0,500,0.00,20820366],[2.171,2.852,2.968]],[85240204,[1,0,1,0,500,0.00,20820366],[1.62,2.21]]],1],[1,4892,[4389539,'Defensores de Belgrano','San Martin Tucuman','1.036-E1487220606003',10,'06/07/2022 08:10','',0,0,1,,{}],,[[15,15,[]],[84784120,[1,0,1,0,1000,-0.25,20820367],[1.87,1.93]],[84784124,[5,0,5,0,500,0.00,20820367],[3.16,2.689,2.171]],[85240206,[1,0,1,0,500,0.00,20820367],[2.29,1.57]]],2],[1,1415,[4381113,'Guarani SP','Operario Ferroviario Esporte Clube','1.032-E1483220606001',10,'06/07/2022 07:00','',0,0,1,,{}],,[[15,15,[]],[84509171,[1,0,1,0,2000,0.50,20680760],[1.90,1.96]],[84509176,[5,0,5,0,1000,0.00,20680760],[1.873,3.16,3.592]],[85252217,[1,0,1,0,1000,0.25,20680760],[1.65,2.26]]],1],[1,5737,[4392235,'Montevideo Wanderers','CA Boston River','1.033-E1498220606001',10,'06/07/2022 05:30','',0,0,1,,{}],,[[15,15,[]],[84873469,[1,0,1,0,500,0.25,20864592],[2.13,1.68]],[84873473,[5,0,5,0,500,0.00,20864592],[2.286,3.064,2.612]],[85240105,[1,0,1,0,1000,0.00,20864592],[1.77,2.03]]],3],[1,100982,[4387904,'Rosario Central','Lanus','1.030-E1456220606001',10,'06/07/2022 06:00','',0,0,1,20,{}],,[[19,19,[]],[84743994,[1,0,1,0,2000,0.25,20798456],[1.91,1.97]],[84743999,[5,0,5,0,1000,0.00,20798456],[2.161,3.064,3.16]],[84744598,[1,0,1,0,500,0.00,20798456],[1.62,2.35]],[85251994,[1,0,1,0,1000,0.50,20798456],[2.19,1.72]]],1],[1,100982,[4387905,'Argentinos Juniors','CA Aldosivi','1.030-E1456220606002',10,'06/07/2022 08:30','',0,0,1,,{}],,[[19,19,[]],[84744062,[1,0,1,0,2000,1.00,20798487],[1.87,2.01]],[84744067,[5,0,5,0,1000,0.00,20798487],[1.489,3.832,5.80]],[84744600,[1,0,1,0,1000,1.25,20798487],[2.16,1.74]],[85251998,[1,0,1,0,500,0.75,20798487],[1.62,2.35]]],1],[1,189,[4362518,'Botafogo RJ','Goias','1.029-E1425220606001',10,'06/07/2022 07:00','',0,0,1,15,{}],,[[19,19,[]],[83943500,[1,0,1,0,3000,1.00,20426825],[2.21,1.70]],[83943501,[1,0,1,0,5000,0.75,20426825],[1.86,2.02]],[83943504,[5,0,5,0,2000,0.00,20426825],[1.604,3.448,5.80]],[84787170,[1,0,1,0,2000,0.50,20426825],[1.62,2.35]]],1],[1,58274,[4362383,'St. Vincent & Grenadines','Nicaragua','1.034-E1410220606001',10,'06/07/2022 03:00','',0,0,1,,{}],,[[10,10,[]],[83935537,[1,0,1,0,1000,-1.00,20421970],[1.90,1.90]],[83935539,[5,0,5,0,500,0.00,20421970],[4.552,3.976,1.489]],[85253364,[1,0,1,0,500,-0.75,20421970],[2.19,1.64]]],2],[1,58274,[4362382,'Trinidad & Tobago','Bahamas','1.034-E1410220606002',10,'06/07/2022 08:00','',0,0,1,,{}],,[[3,3,[]],[83935524,[1,0,1,0,1000,2.50,20421969],[1.68,2.13]]],1],[1,58273,[4362349,'Honduras','Curacao','1.031-E1409220606001',10,'06/07/2022 10:00','',0,0,1,,{}],,[[19,19,[]],[83934081,[1,0,1,0,2000,1.00,20421281],[2.06,1.74]],[83934084,[5,0,5,0,1500,0.00,20421281],[1.556,3.304,5.032]],[85217067,[1,0,1,0,3000,0.75,20421281],[1.76,2.04]],[85217197,[1,0,1,0,1000,1.25,20421281],[2.36,1.53]]],1],[1,7027,[4400798,'PK Keski Uusimaa','Peli Karhut','1.016-E0851220606001',10,'06/06/2022 23:59','',0,0,1,,{}],,[[15,15,[]],[85176510,[1,0,1,0,1000,0.50,21029427],[1.97,1.83]],[85176514,[5,0,5,0,500,0.00,21029427],[1.95,3.544,2.843]],[85240135,[1,0,1,0,500,0.25,21029427],[1.74,2.06]]],1],[1,92035,[4347157,'Republic of Ireland U21','Montenegro U21','1.010-E0473220606002',10,'06/06/2022 23:59','',0,0,1,13,{}],,[[19,19,[]],[83458782,[1,0,1,0,2000,0.25,20204955],[1.57,2.29]],[83458787,[5,0,5,0,2000,0.00,20204955],[1.748,3.208,3.784]],[85146477,[1,0,1,0,5000,0.75,20204955],[2.02,1.78]],[85146488,[1,0,1,0,3000,0.50,20204955],[1.77,2.03]]],1],[1,92035,[4347158,'Luxembourg U21','Italy U21','1.010-E0473220606003',10,'06/06/2022 23:59','',0,0,1,10,{}],,[[7,7,[]],[83458795,[1,0,1,0,5000,-2.50,20204956],[2.02,1.78]],[85231664,[1,0,1,0,3000,-2.75,20204956],[1.79,2.01]]],2],[1,92035,[4347159,'Armenia U21','France U21','1.010-E0473220606005',10,'06/07/2022 00:30','',0,0,1,11,{}],,[[7,7,[]],[83458808,[1,0,1,0,5000,-3.00,20204957],[1.86,1.94]],[85231662,[1,0,1,0,3000,-2.75,20204957],[2.11,1.70]]],2],[1,49226,[4254101,'Iceland','Albania','1.004-E0083220606001',10,'06/07/2022 02:45','',0,0,1,4,{}],,[[30,30,[]],[80597172,[1,0,1,0,2000,-0.50,18970776],[1.50,2.61]],[80597177,[5,0,5,0,5000,0.00,18970776],[2.968,2.708,2.612]],[84755960,[1,0,1,0,3000,0.25,18970776],[2.36,1.61]],[85133687,[1,0,1,0,12000,0.00,18970776],[1.98,1.90]],[85217026,[1,0,1,0,5000,-0.25,18970776],[1.65,2.29]]],3],[1,63464,[4386021,'Fortaleza C.E.I.F.','Deportes Quindio','1.038-E1538220606003',10,'06/07/2022 08:40','',0,0,1,0,{}],,[[15,15,[]],[84687743,[1,0,1,0,1000,0.25,20768977],[1.89,1.91]],[84687747,[5,0,5,0,500,0.00,20768977],[2.036,3.016,3.112]],[85251897,[1,0,1,0,500,0.50,20768977],[2.07,1.73]]],1],[1,57774,[4400799,'Nykarleby IK','Esse IK','1.024-E0942220606001',10,'06/06/2022 23:59','',0,0,0,0,{}],,[[3,3,[]],[85176550,[1,0,1,0,300,0.00,21029438],[2.03,1.69]]],3],[1,54271,[4400752,'Atletico Mineiro (w)','Red Bull Bragantino (w)','1.044-E1651220606001',10,'06/07/2022 04:30','',0,0,1,0,{}],,[[8,8,[]],[85175540,[1,0,1,0,500,1.25,21028801],[1.77,1.99]],[85175542,[5,0,5,0,500,0.00,21028801],[1.326,4.648,5.224]]],1],[1,158357,[4401339,'Equatorial Guinea','Libya','1.013-E1323220606001',10,'06/07/2022 03:00','',0,0,1,0,{}],,[[15,15,[]],[85201876,[1,0,1,0,1000,0.25,21038446],[1.75,2.05]],[85201881,[5,0,5,0,500,0.00,21038446],[2.008,2.833,3.352]],[85252641,[1,0,1,0,500,0.50,21038446],[2.04,1.76]]],1],[1,169147,[4403393,'Algeria','Niger','1.013-E1922220606002',10,'06/07/2022 03:30','',0,0,1,0,{}],,[[10,10,[]],[85269821,[1,0,1,0,1000,2.00,21073520],[1.81,1.99]],[85269825,[5,0,5,0,500,0.00,21073520],[1.153,6.76,8.20]],[85270285,[1,0,1,0,500,2.25,21073520],[2.13,1.68]]],1]],[],[]]],{1:73,2:32,3:24,4:22,5:19,6:58,7:15,8:127,9:370},{3:190,9:139,99:83,1:190,7:139,4:31,14:28,8:56,5:61,2:66,6:31,15:56,16:3,17:1,13:26,10:26},0]"

So far, I know I need to change the ' from the inside which can be done by data.replace("'",'"')

apparently, if a list is like this [123,,34] this creates a problem so it must be dealt with as well. I thought of data.replace(',,',') but I’m not sure if there is a better way.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Finally, the last mistake I was able to catch is one regarding the dicts.
Here {1:73,2:32,3:24,4:22,5:19,6:58,7:15,8:127,9:370} it expects string keys instead of numbers.

So, overall when I do json.loads(data) it gives the following error.

JSONDecodeError: Expecting property name enclosed in double quotes

How can I get the string from above to a list of objects?

>Solution :

For the data given in the question, this should help. Use re.sub to substitute repeating sequences of commas with a single comma. Then you can use ast.literal_eval to convert to a Python dictionary then convert again to JSON. Due to its size I have not included the source data in this answer. Let’s assume it’s a string called str_

from re import sub
from ast import literal_eval
from json import dumps

str_ = sub(',+', ',', str_)
d = literal_eval(str_)
print(dumps(d, indent=2))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading