62,614
社区成员
发帖
与我相关
我的任务
分享
no-cspf;
label-switched-path To-R5 {
from 1.1.1.1;
to 5.5.5.5;
description test
revert-timer 600;
no-decrement-ttl;
retry-timer 100;
retry-limit 100;
primary R5-s1;
secondary R5-s2 {
select manual;
standby;
}
secondary R5-s4 {
standby;
}
secondary R5-s3;
secondary R5-s5;
}
label-switched-path To-R6 {
from 1.1.1.1;
to 6.6.6.6;
revert-timer 600;
primary R6-s1;
secondary R6-s2 {
standby;
}
secondary R6-s3;
}
path path-l2-vpn-pe30-111 {
10.255.2.10 strict;
}
path path-l2-vpn-pe30-1112 {
10.0.96.10 loose;
}
path R5-s3;
path R6-s1 {
10.10.51.5 strict;
10.10.65.6 strict;
}
path R6-s2 {
10.10.21.2 strict;
10.10.92.9 strict;
10.10.109.10 strict;
10.10.104.4 strict;
10.10.84.8 strict;
10.10.87.7 strict;
10.10.127.12 strict;
10.10.112.11 strict;
10.10.116.6 strict;
}
path R6-s3;
interface ge-0/0/0.0;
interface ge-0/1/0.0;
interface lo0.0;
File f = new File(sourcePath);
byte[] b = new byte[(int) f.length()];
FileInputStream fi = new FileInputStream("show_configuration_protocols_mpls.txt");
fi.read(b);
String s = new String(b);
String[] sd = s.split("^}$");
System.out.println(sd.length);
public static void main(String[] args)throws Exception {
File f = new File("1.txt");
byte[] b = new byte[(int) f.length()];
FileInputStream fi = new FileInputStream(f);
fi.read(b);
String s = new String(b);
String[] sd = s.split("(?m)^\\s*}$");
System.out.println(sd.length);
for(int i=0;i<sd.length;i++){
System.out.println(sd[i]);
System.out.println("----------------------");
}
}