2
How can I sort this property file from java project by its value column? The value contains tabs or spaces before or after the value. Here is how this file looks like,
key1 = value1
key2 = value2
key3 = value1
key4 = value3
key5 = value4
key6 = value5
key7 = value2
key8 = value5
key9 = value6
key10 = value5
Now I want this file to be sorted like below. And the spaces or tabs, before or after values should also be trimmed.
key1 = value1
key3 = value1
key2 = value2
key7 = value2
key4 = value3
key5 = value4
key6 = value5
key8 = value5
key10 = value5
key9 = value6
In addition to this I also want to see only key-value pairs having duplicate key, i.e. all key-values should be displayed; except key4, key5 and key9 because they are unique.
It doesn't keep the order of the keys for the same value. – choroba – 2016-07-16T19:43:08.790
@choroba Did you see some part of the question where the OP specified that as desired outcome? – John1024 – 2016-07-16T19:45:35.527
That's how I understood "sorted like below". – choroba – 2016-07-16T19:58:19.280