It appears that every line that is giving you problems has a control code at the beginning of the line. I can't see which control code since I don't have mIRC in front of to to do copy/paste it into to check, but that seems to be the cause. Why it's there, I have no idea. Are you using mIRC's logging or is a script logging? What are your logging settings?