我试图开发一小段代码,这将帮助我划定一个日志文件,该日志文件已将大量跟踪路由存储到一周内发送的不同IP。将日志文件解析为CSV格式
我希望能够在每个跟踪路线的开始和结束处使用'--- START ---'和'--- END ---'标记将它们分开。例子如下:
--- START ---
Mon Mar 12 22:45:05 GMT 2012
traceroute to xxxxxxx (xxxxxxxx), 30 hops max, 60 byte packets
1 xxxxxxx (xxxxx) 1.085 ms 1.662 ms 2.244 ms
2 xxxxxxxx (xxxxxxx) 0.792 ms 0.782 ms 0.772 ms
3 xxxxxxxxx (xxxxxxxxx) 8.545 ms 9.170 ms 9.644 ms
4 etc
5 etc
--- END ---
--- START ---
Mon Mar 12 22:45:05 GMT 2012
traceroute to xxxxxxxxx (xxxxxxxx), 30 hops max, 60 byte packets
1 139.222.0.1 (xxxxxxxxx) 0.925 ms 1.318 ms 1.954 ms
2 10.0.0.1 (xxxxxxxx) 0.345 ms 0.438 ms 0.496 ms
3 172.16.0.34 (xxxxxxxxx) 0.830 ms 2.553 ms 0.809 ms
4 etc
5 etc
6 etc
--- END ---
谁能给我一只手伸进如何做到这一点做,在MATLAB或Java ......我也想算每一跳的路由跟踪,使量。这是
干杯--- END ---标签抛出之前给出的数字...
任何帮助将不胜感激。
只要看看每一行的第一个字母。如果它在CAPS中:它是第一个包含日期的行。如果它是小写字母(traceroute),它是第二行。如果它是数字:它是“跳跃”线之一。 – wildplasser 2012-03-18 21:35:04