我需要解析实时聊天对话的抄本。我第一次看到这个文件的想法是抛出正则表达式的问题,但我想知道人们使用了什么其他方法。
我把这个标题放在了优雅的位置,我以前发现这种类型的任务有一个很难保持只是依赖于正则表达式的危险。
成绩单由www.providesupport.com生成,并通过电子邮件发送到一个帐户,然后从电子邮件中提取一个纯文本的附件。
解析文件的原因是提取会话文本以供稍后,但也可以识别访问者和运算符名称,以便可以通过CRM提供信息。
这是一个抄本文件的例子:
Chat Transcript
Visitor: Random Website Visitor
Operator: Milton
Company: Initech
Started: 16 Oct 2008 9:13:58
Finished: 16 Oct 2008 9:45:44
Random Website Visitor: Where do i get the cover sheet for the TPS report?
* There are no operators available at the moment. If you would like to leave a message, please type it in the input field below and click "Send" button
* Call accepted by operator Milton. Currently in room: Milton, Random Website Visitor.
Milton: Y-- Excuse me. You-- I believe you have my stapler?
Random Website Visitor: I really just need the cover sheet, okay?
Milton: it's not okay because if they take my stapler then I'll, I'll, I'll set the building on fire...
Random Website Visitor: oh i found it, thanks anyway.
* Random Website Visitor is now off-line and may not reply. Currently in room: Milton.
Milton: Well, Ok. But… that's the last straw.
* Milton has left the conversation. Currently in room: room is empty.
Visitor Details
---------------
Your Name: Random Website Visitor
Your Question: Where do i get the cover sheet for the TPS report?
IP Address: 255.255.255.255
Host Name: 255.255.255.255
Referrer: Unknown
Browser/OS: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)