to a format where I can obtain the;vsan 1060 wwn 20:00:00:e0:69:41:26:e7 fcid 0x6d0d00 area dynamic vsan 1030 wwn 10:00:00:00:c9:28:29:44 fcid 0xa70001 dynamic vsan 1030 wwn 10:00:00:00:c9:28:2c:55 fcid 0xa70002 dynamic vsan 1060 wwn 50:06:0b:00:00:0b:3a:0e fcid 0x6d0e00 area dynamic vsan 1060 wwn 20:00:00:e0:69:41:3b:ca fcid 0x6d0f00 area dynamic vsan 1060 wwn 20:00:00:e0:69:40:d1:3f fcid 0x6d1000 area dynamic vsan 1060 wwn 20:00:00:e0:69:41:55:1f fcid 0x6d1100 area dynamic vsan 1060 wwn 20:00:00:e0:69:41:57:1e fcid 0x6d1200 area dynamic vsan 1060 wwn 10:00:00:00:c9:45:3a:21 fcid 0x6d0006 dynamic vsan 1060 wwn 20:00:00:e0:69:41:55:ff fcid 0x6d1300 area dynamic vsan 1050 wwn 50:06:0b:00:00:30:0d:f4 fcid 0x140100 area dynamic logging server 10.33.34.235 6 interface port-channel 1 switchport trunk allowed vsan 1000 switchport trunk allowed vsan add 1050 switchport description To CCC219 10.33.81.56 switchport mode E interface port-channel 3 switchport trunk allowed vsan 1000 switchport trunk allowed vsan add 1010 switchport trunk allowed vsan add 1050 switchport trunk allowed vsan add 1900 switchport description To CCC215 10.33.81.52 switchport mode E vsan database vsan 1050 interface port-channel 1 vsan 1060 interface fc1/3 vsan 1060 interface fc1/4 vsan 1060 interface fc1/8 vsan 1050 interface fc1/12 vsan 1060 interface fc1/14 vsan 1060 interface fc1/15 vsan 1010 interface fc1/16 vsan 1900 interface fc2/1 vsan 1060 interface fc2/3 vsan 1010 interface fc2/4 vsan 1050 interface fc2/7
I tried splitting like sointerface port-channel {Number} = switchport description To {CCCswitch +_number, i.e either CCC215 or CCC219}
But what I got was the whole log file as one array element!if ($Info =~ /show running-config/) { my @array = (split /^\n+$/,$Info); #for my $stuff (@array) #{ #print "$stuff\n"; #} #$var1= $1, next if (/(interface port-channel \d+)$/); print "$array[1]\n"; } }
I didn't get any out put this time...Himmmmmmmm!!!my ($var1, $var2); if ($Info =~ /show running-config/) { $var1 = $1, next if (/(interface port-channel \d+)$/); $var2->{$var1}->{$1} = $2 if (m|(description to CCC\d+/\d+)\s+\[(\w+)\ +]|); print "::$1\n"; }
In reply to Another Challenge: Splitting data into chunks part2 by blackadder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |