使用python将大型json文件拆分为多个json文件

时间:2017-09-19 11:12:42

标签: python json

我的json文件格式如下:

{"@context":"http://schema.org","@type":"Person","name":"A KIRAN","worksFor":{"@context":"http://schema.org","@type":"Corporation","legalName":"MAA HOSPITALS (P) LTD","memberOf":{"hostingOrganization":"Employees' Provident Fund Organisation","membershipNumber":"APHYD0061418000","occurrence":{"identifier":{"transactionNumber":"1201702017443"},"all_attributes":{"transactionDate":"2017-02-20","amount":142968.0,"wagesMonth":"January","wagesYear":17,"ecr":"YES","NoofEmployees":100}},"all_attributes":{"officeName":"HYDERABAD"}},"address":"6-3-1092/S1,S2,SANTHISIKARA APTSSOMAJIGUDA,"},"identifier":{"serialNo":1},"memberOf":{"hostingOrganization":"Employees' Provident Fund Organisation","occurrence":{"identifier":{"transactionNumber":"1201702017443"},"all_attributes":{"transactionDate":"2017-02-20","amount":142968.0,"wagesMonth":"January","wagesYear":17,"ecr":"YES","NoofEmployees":100}}}}
{"@context":"http://schema.org","@type":"Person","name":"A Navitha","worksFor":{"@context":"http://schema.org","@type":"Corporation","legalName":"MAA HOSPITALS (P) LTD","memberOf":{"hostingOrganization":"Employees' Provident Fund Organisation","membershipNumber":"APHYD0061418000","occurrence":{"identifier":{"transactionNumber":"1201702017443"},"all_attributes":{"transactionDate":"2017-02-20","amount":142968.0,"wagesMonth":"January","wagesYear":17,"ecr":"YES","NoofEmployees":100}},"all_attributes":{"officeName":"HYDERABAD"}},"address":"6-3-1092/S1,S2,SANTHISIKARA APTSSOMAJIGUDA,"},"identifier":{"serialNo":2},"memberOf":{"hostingOrganization":"Employees' Provident Fund Organisation","occurrence":{"identifier":{"transactionNumber":"1201702017443"},"all_attributes":{"transactionDate":"2017-02-20","amount":142968.0,"wagesMonth":"January","wagesYear":17,"ecr":"YES","NoofEmployees":100}}}}
{"@context":"http://schema.org","@type":"Person","name":"A RAJESHWARI","worksFor":{"@context":"http://schema.org","@type":"Corporation","legalName":"MAA HOSPITALS (P) LTD","memberOf":{"hostingOrganization":"Employees' Provident Fund Organisation","membershipNumber":"APHYD0061418000","occurrence":{"identifier":{"transactionNumber":"1201702017443"},"all_attributes":{"transactionDate":"2017-02-20","amount":142968.0,"wagesMonth":"January","wagesYear":17,"ecr":"YES","NoofEmployees":100}},"all_attributes":{"officeName":"HYDERABAD"}},"address":"6-3-1092/S1,S2,SANTHISIKARA APTSSOMAJIGUDA,"},"identifier":{"serialNo":3},"memberOf":{"hostingOrganization":"Employees' Provident Fund Organisation","occurrence":{"identifier":{"transactionNumber":"1201702017443"},"all_attributes":{"transactionDate":"2017-02-20","amount":142968.0,"wagesMonth":"January","wagesYear":17,"ecr":"YES","NoofEmployees":100}}}}
{"@context":"http://schema.org","@type":"Person","name":"A Sampurna","worksFor":{"@context":"http://schema.org","@type":"Corporation","legalName":"MAA HOSPITALS (P) LTD","memberOf":{"hostingOrganization":"Employees' Provident Fund Organisation","membershipNumber":"APHYD0061418000","occurrence":{"identifier":{"transactionNumber":"1201702017443"},"all_attributes":{"transactionDate":"2017-02-20","amount":142968.0,"wagesMonth":"January","wagesYear":17,"ecr":"YES","NoofEmployees":100}},"all_attributes":{"officeName":"HYDERABAD"}},"address":"6-3-1092/S1,S2,SANTHISIKARA APTSSOMAJIGUDA,"},"identifier":{"serialNo":4},"memberOf":{"hostingOrganization":"Employees' Provident Fund Organisation","occurrence":{"identifier":{"transactionNumber":"1201702017443"},"all_attributes":{"transactionDate":"2017-02-20","amount":142968.0,"wagesMonth":"January","wagesYear":17,"ecr":"YES","NoofEmployees":100}}}}

我想将这个json文件拆分成多个json文件,每个文件包含一些记录。我怎么能做到这一点。

0 个答案:

没有答案