Hi All,
Thanks for your help in advance
I am parsing a log file where the first field of each line can have the same key value but not more than 3 times in a row. Varying value of that first field changes as you go through the log but it either appears 3 times or two and sometimes only once. Example
aaa ... ..... request| ( at the end of each row is "request|")
aaa ... ..... request|
aaa ... ..... request|
ccc ... ..... "
ccc ... .... "
ddd ... .... "
ddd ... .... "
ddd ... .... "
eee ... .... "
ggg ... .... "
ggg ... .... "
HHH ... .... "
kkk ... .... "
kkk ... ..... "
kkk ... .... "
As I read this log file I would like to parse lines on the first field with their matching values and append them to a separate file.. So all 3 lines for aaa, ddd and kkk go to a file, do the same for 2 matching lines and append them to a different file and the rest , single line like eee append to a third file.
so file 1 would have
aaa ... .....
aaa ... .....
aaa ... .....
ddd ... ....
ddd ... ....
ddd ... ....
kkk ... ....
kkk ... ....
kkk ... ....
file 2 would have
ccc ... ....
ccc ... ....
ggg ... ....
ggg ... ....
file 3
eee ... ....
HHH ... ....
Thanks in advance - your help much appreciated