I've got array of objects
[
{
Severity: "<span class='tableActive'></span>",
Name: 'U3B',
'U1A_Shift SCM: UPTT-Pressure (Bara)': '-',
'U1A_Shift SCM: DPTT-Pressure (Bara)': '-',
'U3B SCM: APTT-Pressure (Bara)': '3510.00',
'U3B SCM: UPTT-Pressure (Bara)': '3413.00',
'U1B SCM: DPTT-Pressure (Bara)': '-',
'U1B SCM: UPTT-Pressure (Bara)': '-',
'U3B SCM: DPTT-Pressure (Bara)': '740.00',
'U1A_Shift SCM: UPTT-Temp (DegC)': '-',
'U1A_Shift SCM: DPTT-Temp (DegC)': '-',
'U3B SCM: APTT-Temp (DegC)': '1565.00',
'U3B SCM: UPTT-Temp (DegC)': '2654.00',
'U1B SCM: DPTT-Temp (DegC)': '-',
'U1B SCM: UPTT-Temp (DegC)': '-',
'U3B SCM: DPTT-Temp (DegC)': '3159.00',
'U1B SCM: PCV-CHOKE status - Control position': '-',
'U3B SCM: PCV-CHOKE status - Control position': '-',
'U1A_Shift SCM: PCV-CHOKE status - Control position': '-',
Alarms: 0,
Advisories: 0,
__row_index: 0,
},
]
Hence output should be
[
{
Severity: "<span class='tableActive'></span>",
Name: 'U3B',
'U1A_Shift SCM: UPTT-Pressure (Bara)': '-', // grouped by UPTT-Pressure (Bara)
'U3B SCM: UPTT-Pressure (Bara)': '3413.00',
'U1B SCM: UPTT-Pressure (Bara)': '-',
'U1A_Shift SCM: DPTT-Pressure (Bara)': '-', //grouped by DPTT-Pressure (Bara)
'U1B SCM: DPTT-Pressure (Bara)': '-',
'U3B SCM: DPTT-Pressure (Bara)': '740.00',
'U3B SCM: APTT-Pressure (Bara)': '3510.00', // grouped by APTT-Pressure (Bara)
'U1A_Shift SCM: UPTT-Temp (DegC)': '-', // grouped by UPTT-Temp (DegC)
'U3B SCM: UPTT-Temp (DegC)': '2654.00',
'U1B SCM: UPTT-Temp (DegC)': '-',
'U1A_Shift SCM: DPTT-Temp (DegC)': '-', // grouped by DPTT-Temp (DegC)
'U1B SCM: DPTT-Temp (DegC)': '-',
'U3B SCM: DPTT-Temp (DegC)': '3159.00',
'U3B SCM: APTT-Temp (DegC)': '1565.00', // grouped by APTT-Temp (DegC)
'U1B SCM: PCV-CHOKE status - Control position': '-', // grouped by PCV-CHOKE status - Control position
'U3B SCM: PCV-CHOKE status - Control position': '-',
'U1A_Shift SCM: PCV-CHOKE status - Control position': '-',
Alarms: 0,
Advisories: 0,
__row_index: 0,
}
]
I need to sort this array of objects based on key name which lies after ":" Eg: APTT-Temp (DegC)
I'm listing only single object I receive array of objects though
I need to sort this array of objects, basically group it by the value of key after ":"(colon)