I need help with following:
Input file:
abc message=sent session:111,x,y,z
pqr message=receive session:111,4,5,7
abc message=sent session:123,x,y,z
pqr message=receive session:123,4,5,7
abc message=sent session:342,x,y,z
abc message=sent session:589,x,y,z
pqr message=receive session:589,4,5,7
Output file:
abc message=sent session:111,x,y,z, pqr message=receive session:111,4,5,7
abc message=sent session:123,x,y,z, pqr message=receive session:123,4,5,7
abc message=sent session:342,x,y,z, NOMATCH
abc message=sent session:589,x,y,z, pqr message=receive session:589,4,5,7
Notes:
If you see in source file, for every "sent" message there is "receive"
only for session=342 there is no receive
session is unknow, can't be hardcoded
So merge only those sent and receive where we have matching session number
See Question&Answers more detail:
os