将json数组压缩为所需元素的最佳方法

时间:2019-03-22 14:25:23

标签: arrays json text-manipulation

当页面加载时,我进行JSON调用服务器端。拉取过程需要10秒钟,返回一个巨大的数组,并包含许多不相关的数据。我需要的部件(尤其是每个项目中的ID和另一个ID)是可以安全存储在服务器上的东西,因为它们没有变化。我使用这些ID在了解一项并且需要基于另一项的基础上进行另一项拉动。

我只需要知道如何/可以使用什么程序就可以使用这个巨大的JSON数组,将其复制并说“在新文档中创建这些部分的新数组”。

示例:

巨大的阵列

{
    "AllowMemberCreatedEvents": false,
    "AllowTickets": false,
    "CanMembersInviteOthers": false,
    "CommunityKey": "c0d434c5-b928-4fa8-ad7d-bd5889290c24",
    "LegacyGroupKey": "Chapter_Member_023",
    "CommunityName": "Alpha Alpha Chapter",
    "CommunitySize": 479,
    "CommunityType": null,
    "CommunityTypeKey": "b4551c93-41b4-4da4-9540-22431079d37a",
    "CommunityTypeName": "Chapter",
    "CreatedByContactKey": "7f2de571-92e8-49b0-ba12-27413bf99c95",
    "CreatedOn": "2010-03-23T11:47:09.507Z",
    "Description": "University of North Carolina at Chapel Hill<br>Chapel Hill, NC   USA",
    "Html": "",
    "IsSubscribedToDiscussion": false,
    "IsOnCommunitySync": false,
    "JoinPermissionKey": "c093a5f4-6b5e-434b-abbd-17fea98ee5b4",
    "LibraryKey": "21a61b4e-84d6-4279-9a12-a0aaa57d01b7",
    "LibraryName": "Alpha Alpha Chapter",
    "LinkToCommunity": "http://hiddenfromstackoverflow.com/alphaalphachapter/home",
    "LinkToCommunityCalendar": "http://hiddenfromstackoverflow.com/alphaalphachapter/events/calendar?CommunityKey=c0d434c5-b928-4fa8-ad7d-bd5889290c24",
    "LinkToDiscussion": "http://hiddenfromstackoverflow.com/alphaalphachapter/egroups/digestviewer?ListKey=ad6522a6-2a17-4e9c-89b0-ffea8372115b",
    "LinkToLibrary": "http://hiddenfromstackoverflow.com/alphaalphachapter/resources/librarydocuments?LibraryKey=21a61b4e-84d6-4279-9a12-a0aaa57d01b7",
    "LinkToWebsite": "http://hiddenfromstackoverflow.com/alphaalphachapter/",
    "DiscussionKey": "ad6522a6-2a17-4e9c-89b0-ffea8372115b",
    "DiscussionName": "Alpha Alpha Chapter",
    "MicrositeGroupKey": "2019a857-bd58-46ea-a4a4-7ea16485aa24",
    "SiteName": "alphaalphachapter",
    "ViewPermissionKey": "20a0e086-748a-4309-8c4f-30ff86d62f1a",
    "Statistics": null,
    "CreatedByContact": {
        "LinkToProfile": "https://hiddenfromstackoverflow.com/people/system",
        "PictureUrl": "https://hiddenfromstackoverflow.com/directory/ImageDisplay.aspx?Key=4747bbea-7322-4491-9334-6ae810c250b4&dt=447758747509",
        "ContactKey": "7f2de571-92e8-49b0-ba12-27413bf99c95",
        "FirstName": "",
        "LastName": "System",
        "DisplayName": "System",
        "EmailAddress": "",
        "ContactStatusCode": "A",
        "PrefixCode": "Mr.",
        "UpdatedOn": "2014-06-02T15:01:45.257Z",
        "UpdatedByContactKey": "7f2de571-92e8-49b0-ba12-27413bf99c95",
        "CompanyName": "",
        "CompanyTitle": "",
        "SuffixCode": "",
        "Designation": "",
        "LegacyContactKey": "HL0",
        "InformalName": "",
        "MiddleName": "",
        "IsCompany": false,
        "CompanyLegacyContactKey": "",
        "AMSDirectoryOptOut": true,
        "HLDirectoryOptOut": true,
        "HLContactMeOptOut": false,
        "LargePictureUrl": "https://hiddenfromstackoverflow.com/directory/ImageDisplay.aspx?Key=4ccd3e72-ef26-4e91-a992-ae736adcfd6a&dt=447758747496",
        "AgreedToTermsDateTime": "2010-03-19T15:43:46.837Z"
    },
    "IntegrationKey": "Chapter_Member_023",
    "IntegrationTypeKey": "Chapter",
    "ParentCommunityKey": "00000000-0000-0000-0000-000000000000"
}

对此:

[
    {
        "IntegrationKey": "Chapter_Member_023",
        "CommunityKey" : "c0d434c5-b928-4fa8-ad7d-bd5889290c24"
    }, ...

我真的不想编写整个控制台应用程序来执行此操作,但是如果需要的话,我会这样做。

我拥有MSDN / Visual Studio 2017,Sublime Text和Notepad ++的完整许可证

0 个答案:

没有答案