File looks like this:
———-
[15:41:36] Received packet Message <AmMcmp>
[destination_id=0x0]
[seq=0x10]
[controlmessage=0x7]
[data=0x1 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 ]
from node 119
[15:41:36] Received packet Message <AmSystemCtp>
[seq=0x11]
[etx=0xd]
[parent=0x1]
[num_neighbors=0x9]
from node 119
———-
and we want every event beginning with a timestamp on its own line. We do this in two steps:

Remove all newlines: for t in `cat comms.log`; do echo -n $t" " >> comms.tmp; done

Insert a newline before every timestamp: sed "s/\[..:..:..\]/\n&/g" comms.tmp > commsline.txt

Advertisements