问题描述
你好我的新perl
i必须从网络中解析日志文件
,格式如下:
开始时间:2-16-07 11:27a
从服务器''bliblibli''恢复客户''blablabla''的文件。
恢复:总计恢复所需的估计磁盘空间为3 MB。
将D:\ X \ Y \中的5个文件恢复到E:\restore
请求5个文件( s),这可能需要一段时间......
E:\\\ topore \ blabla \ blablabla.bla
E:\\\ topore \ blabla \ blablabla.bli
E:\\\ topore \ blabla \ blablabla.blu
E:\\\ topore \ lablabla \ blablabla.ble
E:\ ltore; \\ blabla \ blablabla.blo
从NSR服务器收到5个文件''blablabla''
恢复完成时间: 2月16日星期五11:30:52
和数据,我需要:
开始时间,完成时间,客户名称,服务器名称,总文件和磁盘空间
i有正则表达式,grep,split的问题。有人可以帮助我吗?
thx before =)
开始时间:2-16-07 11:27a
从服务器''bliblibli'恢复客户''blablabla''的文件'。
恢复:恢复所需的总磁盘空间估计为3 MB。
将D:\ X \ Y \中的5个文件恢复到E:\恢复
---->这是oke ..
然后我怎样才能到最后一行获得完成日期,
因为每个文件都有不同要恢复的文件数量。(在这个例子中是5个文件)
i没有创建循环的想法
hello im new with perl
i must do parse log file from networker
with format look like this :
Start time: 2-16-07 11:27a
Recovering files of client ''blablabla'' from server ''bliblibli''.
Recover: Total estimated disk space needed for recover is 3 MB.
Recovering 5 files within D:\X\Y\ into E:\restore
Requesting 5 file(s), this may take a while...
E:\restore\blabla\blablabla.bla
E:\restore\blabla\blablabla.bli
E:\restore\blabla\blablabla.blu
E:\restore\blabla\blablabla.ble
E:\restore\blabla\blablabla.blo
Received 5 file(s) from NSR server ''blablabla''
Recover completion time: Fri Feb 16 11:30:52 2007
and the data,i need:
start time,completion time,client name,server name,total file,and disk space
i have problem with regex,grep,split..is anyone can help me?
thx before =)
Start time: 2-16-07 11:27a
Recovering files of client ''blablabla'' from server ''bliblibli''.
Recover: Total estimated disk space needed for recover is 3 MB.
Recovering 5 files within D:\X\Y\ into E:\restore
----> this is oke..
and then how can i go to the last line to get the completion date,
because every file has different amount of files to recover.(in this example 5 files)
i dont have idea to make the loop
这篇关于解析日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!