I want to sort the following data in a particular order. I tried sort in different way but couldn't find any solution. please help. I am a newbie in Unix.:(
Data:-
method1:entry:2013.09.18.19.18.30
method1:exit:2013.09.18.19.18.30
method2:entry:2013.09.18.19.18.30
method2:exit:2013.09.18.19.18.30
method3:entry:2013.09.18.19.18.30
method4:entry:2013.09.18.19.18.30
method4:exit:2013.09.18.19.18.30
method1:entry:2013.09.18.19.18.30
method1:exit:2013.09.18.19.18.30
method3:exit:2013.09.18.19.18.30
method3:entry:2013.09.18.19.18.30
method5:entry:2013.09.18.19.18.30
method5:exit:2013.09.18.19.18.30
method3:exit:2013.09.18.19.18.30
Desired output:-
method1:entry:2013.09.18.19.18.30
method1:exit:2013.09.18.19.18.30
method1:entry:2013.09.18.19.18.30
method1:exit:2013.09.18.19.18.30
method2:entry:2013.09.18.19.18.30
method2:exit:2013.09.18.19.18.30
method3:entry:2013.09.18.19.18.30
method3:exit:2013.09.18.19.18.30
method3:entry:2013.09.18.19.18.30
method3:exit:2013.09.18.19.18.30
method4:entry:2013.09.18.19.18.30
method4:exit:2013.09.18.19.18.30
method5:entry:2013.09.18.19.18.30
method5:exit:2013.09.18.19.18.30
The sorting should be based on method name and 'entry-exit' occurrence.
method1:exitshould be placed after amethod1:entry? Bothmethod1:exits are identical. The same is true formethod1:entryitself. You just want to match pairs ofentryandexits which have samemethodname?sort,setorawk). You have to write some python or perl scripts to do this