How can I can sort based on a key word? I have a kind-of complicated list and am wondering if I can sort it. Here is an example:
enter code here Room Name: RM145
,ID,user Name
,300,NOS
,100,NOT
Room Name: RM370
,ID,user Name
,300,NOS
Room Name: RM471
,ID,user Name
,300,POS
,100,NOT
Room Name: RM349
,ID,user Name
,301,NOS
,100,NOT
,500,COS
My objective is to sort this list based on “Room Name“.
I have the file in both plain text and CSV. I don’t know which one is will be easier to sort. Does anyone have suggestions?
With GNU awk 4:
This one should work with older GNU awk versions: