找出文件arp0.txt中所有找出文件arp0.txt中所有
1 时间;
2 ip1;
3 ip2;
4 mac;
并导进另外一个文件中 arp1.txt22:51:46.132995 00:0c:f7:fb:02:18 (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: arp who-has 219.231.1.78 tell 219.231.1.254
22:51:46.133011 00:0c:f7:fb:02:18 (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: arp who-has 219.231.1.23 tell 219.231.1.254
22:51:50.132982 00:0c:f7:fb:02:18 (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: arp who-has 219.231.1.78 tell 219.231.1.254
22:51:51.167636 00:1b:b9:d9:a6:98 (oui Unknown) > 00:0c:f7:fb:02:1c (oui Unknown), ethertype ARP (0x0806), length 42: arp who-has 10.2.105.254 tell 10.2.105.25
22:51:51.167902 00:0c:f7:fb:02:1c (oui Unknown) > 00:1b:b9:d9:a6:98 (oui Unknown), ethertype ARP (0x0806), length 60: arp reply 10.2.105.254 is-at 00:0c:f7:fb:02:1c (oui Unknown)
22:51:54.133034 00:0c:f7:fb:02:18 (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: arp who-has 219.231.1.78 tell 219.231.1.254
22:51:58.184903 00:0c:f7:fb:02:18 (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: arp who-has 219.231.1.23 tell 219.231.1.254
22:52:00.931421 00:1b:b9:a1:fb:9b (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 106: arp who-has 10.2.105.4 tell 10.2.105.100
1 时间;
2 ip1;
3 ip2;
4 mac;
并导进另外一个文件中 arp1.txt22:51:46.132995 00:0c:f7:fb:02:18 (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: arp who-has 219.231.1.78 tell 219.231.1.254
22:51:46.133011 00:0c:f7:fb:02:18 (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: arp who-has 219.231.1.23 tell 219.231.1.254
22:51:50.132982 00:0c:f7:fb:02:18 (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: arp who-has 219.231.1.78 tell 219.231.1.254
22:51:51.167636 00:1b:b9:d9:a6:98 (oui Unknown) > 00:0c:f7:fb:02:1c (oui Unknown), ethertype ARP (0x0806), length 42: arp who-has 10.2.105.254 tell 10.2.105.25
22:51:51.167902 00:0c:f7:fb:02:1c (oui Unknown) > 00:1b:b9:d9:a6:98 (oui Unknown), ethertype ARP (0x0806), length 60: arp reply 10.2.105.254 is-at 00:0c:f7:fb:02:1c (oui Unknown)
22:51:54.133034 00:0c:f7:fb:02:18 (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: arp who-has 219.231.1.78 tell 219.231.1.254
22:51:58.184903 00:0c:f7:fb:02:18 (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: arp who-has 219.231.1.23 tell 219.231.1.254
22:52:00.931421 00:1b:b9:a1:fb:9b (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 106: arp who-has 10.2.105.4 tell 10.2.105.100
解决方案 »
- 调用ArrayList的哪个构造函数;Business层如果传参数等....
- 一个Java程序的运行流程,大家帮忙分析一下思路,共享,感谢
- 关于Arrays类的binarySearch方法
- SWING的小问题!麻烦大家了!谢谢
- 我知道计算机内部用补码表示,那么int i = -1,这个i在内存中如何表示呢
- 有人告诉我吗
- java有没有类似msdn的帮助文档?叫什么名称?在那里下载?
- 求助!!关于两行代码的理解问题!请大虾近来看看!!(在线等待)
- 找兼职开发人员,JAVA,ASP。王先生 13910596228
- JList的疑问
- 请问哪位前辈有java认证的相关资料
- 请问,如何把Image对象转换成byte[]?或者转换成InputStream对象?
String s = "22:51:46.132995 00:0c:f7:fb:02:18 (oui Unknown) > Broadcast, ethertype ARP (0x0806), length 60: arp who-has* 219.231.1.78 tell 219.231.1.254";
Pattern p = Pattern
.compile("(\\d{2}:\\d{2}:\\d{2}.\\d{6})(?:.*?)(\\d{1,3}.\\d{1,3}.\\d{1,3}.\\d{1,3})\\s+tell\\s+(\\d{1,3}.\\d{1,3}.\\d{1,3}.\\d{1,3})\\s*");
Matcher m = p.matcher(s);
while (m.find()) {
System.out.println(m.group(1));
System.out.println(m.group(2));
System.out.println(m.group(3));
}