我有大约20000-30000行长的日志文件,它们包含所有类型的数据,每行以当前时间戳开始,然后是文件路径/linu编号,然后是添加了一些附加(不必要的信息)的对象值。你知道吗
2016/08/31 17:27:43/usr/log/data/old/objec: 540: Adjustment Stat
2016/08/31 17:27:43/usr/log/data/old/objec: 570: Position: 1
2016/08/31 17:27:43/usr/log/data/old/object::1150: Adding new object in department xxxx
2016/08/31 17:27:43/usr/log/data/old/file1.java:: 728: object ID: 0
2016/08/31 17:27:43/usr/log/data/old/file2.java:: 729: Start location:1
2016/08/31 17:27:43/usr/log/data/old/file1.java:: 730: End location:55
2016/08/31 17:27:43/usr/log/data/old/: 728: object ID: 1
2016/08/31 17:27:43/usr/log/data/old/: 729: Start location:56
2016/08/31 17:27:43/usr/log/data/old/: 730: End location:67
2016/08/31 17:27:43/usr/log/data/old/: 728: object ID: 2
2016/08/31 17:27:43/usr/log/data/old/: 729: Start location:68
2016/08/31 17:27:43/usr/log/data/old/: 730: End location:110
Timer to Calculate location of object x took 0.004935 seconds
。。。。 ... ... 相同的信息。。。对于新对象 每个文件有30-40个对象组,它们各不相同(在ID 0-3之间)
I want to extract information (next line after Adjustment Stat)and save in a text file like
Position ObjectID StartLocation EndLocation
0 1 55
1 56 67
2 68 110
。。。 ... ... 你知道吗
(此处没有任何Id为0的对象) 1 1 50 2 51 109 ... 你知道吗
Or may be store in csv file like
0,1,55
1,56,67
2,68,110
2.6版本:
输出.csv(
in.txt
如在OP中)相关问题 更多 >
编程相关推荐