- 论坛徽章:
- 145
|
本帖最后由 jason680 于 2016-10-27 13:30 编辑
回复 1# hope1234567hope
$ awk -vs="[" '/},/{print s"}";s=c=P=""}P{sub(" *= *",":");sub("^ +","");s=s c $0;c=","}/\(PtrOrganization\){/{s=s C "{";P=1;C=","}END{print "]"}' FILE
[{OrganizationNO:"00269904",OrganizationNameShort:"综合办公室厂处级",OrganizationName:"机械分公司综合办公室厂处级",SuperiorNo:"00269881",OrganizationLevel:"二级单位直属机构内设机构",OrganizationLevelCode:"3C",RegionCode:"070",Region:"1省",City:"1市",IsEmptyOrg:None,OrgStartDate:"20161001",OrgEndDate:"99991231",CreateTime:"2005/10/22 12:47:09",LastUpdateTime:"2016/10/12 0:16:59"}
,{OrganizationNO:"00269905",OrganizationNameShort:"综合办公室中干",OrganizationName:"公司综合办公室中干",SuperiorNo:"00269881",OrganizationLevel:"二级单位直属机构内设机构",OrganizationLevelCode:"3C",RegionCode:"070",Region:"2省",City:"2市",IsEmptyOrg:None,OrgStartDate:"20161001",OrgEndDate:"99991231",CreateTime:"2005/10/22 12:47:09",LastUpdateTime:"2016/10/12 0:16:59"}
,{OrganizationNO:"50095191",OrganizationNameShort:"40018队",OrganizationName:"西部40018队",SuperiorNo:"65118390",OrganizationLevel:"三级单位",OrganizationLevelCode:"40",RegionCode:"550",Region:"3省",City:"3市",IsEmptyOrg:None,OrgStartDate:"20161001",OrgEndDate:"99991231",CreateTime:"2005/10/22 12:42:20",LastUpdateTime:"2016/10/13 0:16:59"}
]
|
|