I am trying to figure out a linux shell command which will display portion of a field from a log satisfying condition of other field.
Sample log-file:
2013-04-15;[email protected];[email protected];outgoing;24;headline
2013-04-15;[email protected];[email protected];incoming;0;chat
2013-04-15;[email protected];[email protected];outgoing;26;headline
2013-04-15;[email protected];333333;incoming;12;chat
2013-04-16;[email protected];555555;incoming;0;chat
I tried to display only the unique numbers from field 2 and 3 separated by delimiter ';' where field 5 != 0
Sample expected output:
111111
333333
444444
Explanation: extract columns 2 and 3 based on column 5 value; match only the numbers; eliminate duplicates