Shoutbox

Merging chat logs - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Skype & Live Messenger (/forumdisplay.php?fid=10)
+----- Thread: Merging chat logs (/showthread.php?tid=58807)

Merging chat logs by giken on 04-27-2006 at 08:55 AM

Is there a way to merge two messenger xml chat logs?

I use WLM at home and at work so I have two different chat archives with two xml files for every contact I used to talk to.

I'd like to merge them to get one big chat archive only.

How can I do that?


RE: Merging chat logs by Funness on 04-27-2006 at 09:37 AM

I assume he put his name when they asked for them.

You may just beable to append one logs to the other. Although this would throw out the time stamps.


RE: Merging chat logs by CookieRevised on 04-27-2006 at 02:06 PM

quote:
Originally posted by giken
Is there a way to merge two messenger xml chat logs?

I use WLM at home and at work so I have two different chat archives with two xml files for every contact I used to talk to.

I'd like to merge them to get one big chat archive only.

How can I do that?

Open up the XML log and study its format...

The structure of XML logs (from both Messenger 7.5 and lower, and WLM 8.0) is something like this:

code:
<?xml version="1.0"?>
<?xml-stylesheet type='text/xsl' href='MessageLog.xsl'?>
<Log LogonName="bebop_007@hotmail.com" FirstSessionID="1" LastSessionID="123">
      <Message Date="..." Time="..." DateTime="..." SessionID="1">
            <From><User LogonName="me@mail.com" FriendlyName="my name"/></From>
            <To><User LogonName="he@mail.com" FriendlyName="his name"/></To>
            <Text Style="...">chat blah blah</Text>
      </Message>
      <Message Date="..." Time="..." DateTime="..." SessionID="2">
            <From><User LogonName="me@mail.com" FriendlyName="my name"/></From>
            <To><User LogonName="he@mail.com" FriendlyName="his name"/></To>
            <Text Style="...">chat blah blah</Text>
      </Message>
      <Message Date="..." Time="..." DateTime="..." SessionID="3">
            <From><User LogonName="me@mail.com" FriendlyName="my name"/></From>
            <To><User LogonName="he@mail.com" FriendlyName="his name"/></To>
            <Text Style="...">chat blah blah</Text>
      </Message>
      ...
      <Message Date="..." Time="..." DateTime="..." SessionID="123">
            <From><User LogonName="me@mail.com" FriendlyName="my name"/></From>
            <To><User LogonName="he@mail.com" FriendlyName="his name"/></To>
            <Text Style="...">merged chat line from other file blah blah</Text>
      </Message>
</Log>


To merge two XML files all you need to do is copy the contents from one file to the other. But only copy the contents between the <log></log> tags, as there can only be 1 of such tag (eg: the chat line with SessionID 123 was copied from another log).

You'll also notice the elements FirstSessionID and LastSessionID in the <log/> tag. If possible, change these accordingly (eg: by means of a specific (non yet existing) merging tool. But it also means that you need to change/update all the SessionID elements in the <Message/> tags. The SessionID, FirstSessionID and LastSessionID elements aren't used (yet) though, so you may also leave them as they are for now. Simply copying everything between the <log></log> tags is sufficient to merge them.


PS: be carefull what to copy from logs of a multi-conversations though.

;)


quote:
Originally posted by Funness
You may just beable to append one logs to the other. Although this would throw out the time stamps.
Unfortunatly not, there can only be 1 tag at the highest level in an XML file*.

Nothing will be thrown out either. Also, timestamps wouldn't be a problem if he never chatted (or logs were saved from contacts contacting him) with both computers at the same time. But he indeed must be "carefull" in his copying so that he respects the order of the timestamps (otherwise the viewed log would jump from one time to the other and back, but nothing will be broken though, it would just be a bit dodgy to read again)...

* and because of that, merging must either be done manually by copy/pasting, or someone must write a program which does this for him. Simply copy-merging whole files together won't work.




quote:
Originally posted by GHOST OF DA AGES
An official tester could help as others dont know about Msg+ live! And u too r an official tester.*GHOST wonders how did he/she become an official tester?
He's not talking about Messenger Plus! in any way.

RE: Merging chat logs by giken on 04-30-2006 at 07:44 PM

Thanks Cookie for the answer :)

I was looking for some kind of automatic tool to do that :)

Maybe a batch file?


RE: Merging chat logs by CookieRevised on 05-01-2006 at 10:23 AM

A batch file mainly automates file handling and stuff. It isn't suited for file contents manipulation. Making a batch file for this is possible, but it would require a very dodgy and way too complicated routine to pull it off.

If you want to do this with something similar like batch files, use/make a VBS script instead.

Note: Any automatic tool which does this either needs to be XML aware (and check for the order of those time/date tags)... or you can make it very straitforward and crude but then you should be very carefully in what files you merge and which not with this tool(/script).