大家好,我有一个任务来分析这样一个有些日志文件:批次:计算时间从时间戳经过
12:03:11 Testing Import (test #240.)
12:10:47 Testing Searches (test #241.)
12:14:39 Testing Default notifications (test #242.)
12:20:05 Testing Inventory list monitor (test #243.)
12:34:31 Testing Reports from console (test #244.)
12:40:05 Testing Users and user groups (test #245.)
12:43:33 ERROR: 1024 characters in field Name, warning not shown!
12:48:13 Testing RDE (test #246.)
和我的工作是计算每个测试运行时间,并将其写入到另一个TXT文件。当然行这样一个
12:43:33 ERROR: 1024 characters in field Name, warning not shown!
不应予以考虑。所以这个字符串(test #
可以作为某种标识符。最好的语言是批处理,但我真的有限的经验,所以任何帮助将是有用的。谢谢!
是批次的要求?它并不是最适合这样的任务;甚至可以做,如果没有其他选项,但通常我会建议像python甚至像graylog等专用日志解析解决方案。 – Drako
没有日期条目,所以持续时间计算可能不可靠... – aschipfl
请注意https://stackoverflow.com不是一个免费的脚本/代码写作服务。如果您告诉我们您迄今为止所尝试的内容(包括您已经使用的脚本/代码)以及您卡住的位置,那么我们可以尝试帮助解决特定问题。您还应该阅读[我如何提出一个好问题?](https://stackoverflow.com/help/how-to-ask)。 – DavidPostill