0

I have json file with the format given below:

{"@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}}}}

I want to split this json file into multiple json file, with each file containing some number of records. How I can achieve this.

neha
  • 1,858
  • 5
  • 21
  • 35
  • 2
    That doesn't look like a valid json file, is it "json lines"/"ndjson"? What are your attempts so far? – roganjosh Sep 19 '17 at 11:17
  • You can load each record of json in memory and then split it and save records in different files – Roomm Sep 19 '17 at 11:29

0 Answers0