我有一个通过组合其他两个数组构成的数组。新数组具有基于属性(id)连接的原始数组中的所有数据。我想制作一个新数组,将所有属性(id)值组合到一个字符串中,而无需复制数据。数据具有许多不同的(属性和属性值)对,但其余数据相同。这是两个数据示例:
0:
id: "00ABCD-0003"
AccessionID: "UWAR_007_Test"
Attribute: "Object Type"
AttributeValue: "Glass"
BoxNumber: "2000"
CatalogDate: null
Cataloger: "rkirkwo2@uwyo.edu"
FSNumber: null
FreeformValue: null
ProjectNumber: "#154 WAPA"
SiteID: "00ABCD"
Units: null
1:
id: "00ABCD-0003"
AccessionID: "UWAR_007_Test"
Attribute: "Glass Material Type"
AttributeValue: "Aluminosilicate glass"
BoxNumber: "2000"
CatalogDate: null
Cataloger: "rkirkwo2@uwyo.edu"
FSNumber: null
FreeformValue: null
ProjectNumber: "#154 WAPA"
SiteID: "00ABCD"
Units: null
以下是完整数据数组。谢谢你的帮助!
数据将被用于打印出博物馆的标签,以便将其放入存放文物的袋子中。因此,我需要能够获得的所有数据而无需重复任何操作。
listArray =[{"id":"00ABCD-0003","SiteID":"00ABCD","AccessionID":"UWAR_007_Test","ProjectNumber":"#154 WAPA","FSNumber":null,"BoxNumber":"2000","ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Object Type","AttributeValue":"Glass","FreeformValue":null,"Units":null},{"id":"00ABCD-0003","SiteID":"00ABCD","AccessionID":"UWAR_007_Test","ProjectNumber":"#154 WAPA","FSNumber":null,"BoxNumber":"2000","ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Glass Material Type","AttributeValue":"Aluminosilicate glass","FreeformValue":null,"Units":null},{"id":"00ABCD-0003","SiteID":"00ABCD","AccessionID":"UWAR_007_Test","ProjectNumber":"#154 WAPA","FSNumber":null,"BoxNumber":"2000","ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Color","AttributeValue":"Brown","FreeformValue":null,"Units":null},{"id":"00ABCD-0003","SiteID":"00ABCD","AccessionID":"UWAR_007_Test","ProjectNumber":"#154 WAPA","FSNumber":null,"BoxNumber":"2000","ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Glass Object Type","AttributeValue":"Bead","FreeformValue":null,"Units":null},{"id":"00ABCD-0001","SiteID":"00ABCD","AccessionID":"UWAR_007_Test","ProjectNumber":"#154 WAPA","FSNumber":"f2","BoxNumber":"1000","ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Datum ID (if known)","AttributeValue":null,"FreeformValue":"NAD83","Units":null},{"id":"00ABCD-0001","SiteID":"00ABCD","AccessionID":"UWAR_007_Test","ProjectNumber":"#154 WAPA","FSNumber":"f2","BoxNumber":"1000","ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Object Type","AttributeValue":"Concrete","FreeformValue":null,"Units":null},{"id":"00ABCD-0001","SiteID":"00ABCD","AccessionID":"UWAR_007_Test","ProjectNumber":"#154 WAPA","FSNumber":"f2","BoxNumber":"1000","ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Concrete Object Type","AttributeValue":"General Building Material","FreeformValue":null,"Units":null},{"id":"00ABCD-0001","SiteID":"00ABCD","AccessionID":"UWAR_007_Test","ProjectNumber":"#154 WAPA","FSNumber":"f2","BoxNumber":"1000","ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Concrete Material Type","AttributeValue":"Cellular concrete","FreeformValue":null,"Units":null},{"id":"00ABCD-0001","SiteID":"00ABCD","AccessionID":"UWAR_007_Test","ProjectNumber":"#154 WAPA","FSNumber":"f2","BoxNumber":"1000","ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Provenience","AttributeValue":"Surface Collection","FreeformValue":null,"Units":null},{"id":"00ABCD-0001","SiteID":"00ABCD","AccessionID":"UWAR_007_Test","ProjectNumber":"#154 WAPA","FSNumber":"f2","BoxNumber":"1000","ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Datum Location","AttributeValue":"UTMs","FreeformValue":null,"Units":null},{"id":"00ABCD-0001","SiteID":"00ABCD","AccessionID":"UWAR_007_Test","ProjectNumber":"#154 WAPA","FSNumber":"f2","BoxNumber":"1000","ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"UTM Zone","AttributeValue":"12N","FreeformValue":null,"Units":null},{"id":"00ABCD-0002","SiteID":"00ABCD","AccessionID":"UWAR_010_Test","ProjectNumber":"#154 WAPA","FSNumber":null,"BoxNumber":null,"ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Object Type","AttributeValue":"Metal","FreeformValue":null,"Units":null},{"id":"00ABCD-0002","SiteID":"00ABCD","AccessionID":"UWAR_010_Test","ProjectNumber":"#154 WAPA","FSNumber":null,"BoxNumber":null,"ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Metal Material Type","AttributeValue":"Brass","FreeformValue":null,"Units":null},{"id":"00ABCD-0002","SiteID":"00ABCD","AccessionID":"UWAR_010_Test","ProjectNumber":"#154 WAPA","FSNumber":null,"BoxNumber":null,"ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Metal Object Type","AttributeValue":"Axe","FreeformValue":null,"Units":null},{"id":"00ABCD-0004","SiteID":"00ABCD","AccessionID":"UWAR-125-2019-14","ProjectNumber":"#190","FSNumber":null,"BoxNumber":null,"ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Object Type","AttributeValue":"Rubber","FreeformValue":null,"Units":null},{"id":"00ABCD-0004","SiteID":"00ABCD","AccessionID":"UWAR-125-2019-14","ProjectNumber":"#190","FSNumber":null,"BoxNumber":null,"ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Rubber Object Type","AttributeValue":"Tire","FreeformValue":null,"Units":null},{"id":"00ABCD-0004","SiteID":"00ABCD","AccessionID":"UWAR-125-2019-14","ProjectNumber":"#190","FSNumber":null,"BoxNumber":null,"ArtifactCount":null,"Cataloger":"rkirkwo2@uwyo.edu","CatalogDate":null,"ArtifactNotes":null,"Attribute":"Rubber Material Type","AttributeValue":"Natural Rubber","FreeformValue":null,"Units":null}]
例如,我想看看:
id: "00ABCD-0003"
AccessionID: "UWAR_007_Test"
Attribute: "Object Type"
AttributeValue: "Glass"
Attribute: "Glass Material Type"
AttributeValue: "Aluminosilicate glass"
BoxNumber: "2000"
CatalogDate: null
Cataloger: "rkirkwo2@uwyo.edu"
FSNumber: null
FreeformValue: null
ProjectNumber: "#154 WAPA"
SiteID: "00ABCD"
Units: null
答案 0 :(得分:0)