I want to sort by array which contains value having colon (:)
This is the below input
[
'Severity',
'Name',
'U1A_Shift SCM: UPTT-Pressure (Bara)',
'U1A_Shift SCM: DPTT-Pressure (Bara)',
'U3B SCM: APTT-Pressure (Bara)',
'U3B SCM: UPTT-Pressure (Bara)',
'U1B SCM: DPTT-Pressure (Bara)',
'U1B SCM: UPTT-Pressure (Bara)',
'U3B SCM: DPTT-Pressure (Bara)',
'U1A_Shift SCM: UPTT-Temp (DegC)',
'U1A_Shift SCM: DPTT-Temp (DegC)',
'U3B SCM: APTT-Temp (DegC)',
'U3B SCM: UPTT-Temp (DegC)',
'U1B SCM: DPTT-Temp (DegC)',
'U1B SCM: UPTT-Temp (DegC)',
'U3B SCM: DPTT-Temp (DegC)',
'U1B SCM: PCV-CHOKE status - Control position',
'U3B SCM: PCV-CHOKE status - Control position',
'U1A_Shift SCM: PCV-CHOKE status - Control position',
'Alarms',
'Advisories',
'__row_index'
]
I want to sort / group it by the value after colon (:)
This should be below output
[
'Severity',
'Name': 'U3B',
'U1A_Shift SCM: UPTT-Pressure (Bara)', // grouped by UPTT-Pressure (Bara)
'U3B SCM: UPTT-Pressure (Bara)',
'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)',
'U3B SCM: APTT-Pressure (Bara)', // grouped by APTT-Pressure (Bara)
'U1A_Shift SCM: UPTT-Temp (DegC)', // grouped by UPTT-Temp (DegC)
'U3B SCM: UPTT-Temp (DegC)',
'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)',
'U3B SCM: APTT-Temp (DegC)', // 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',
'Advisories',
'__row_index',
]
I need to sort this array value which lies after ":" Eg: APTT-Temp (DegC)
How can i sort / group array values
Any help would by highly appreciated :)