Hello Perl Gurus.
I have a question about , how to read block of text file, for example i have a text file in next format:
MR_ManagedObject
true
2
LINK-PORT-10.112.32.73/1003<->PORT-10.112.32.81/8026
Switch
10.112.32.73
Switch
10.112.32.81
TrunkCable
LINK-PORT-10.112.32.73/1003<->PORT-10.112.32.81/8026
TrunkCable
false
1
10.112.32.33
ROSPD-TVE-Vadkov20
Switch
10.112.32.33
graph: 0
{
topology:
{
node: 1
{
type: 0
INCHARGE-SA-ROSPD
INCHARGE-SA-ROSPD::Node::10.112.32.82
0
false
false
10.112.32.82
MR_ManagedObject
0
text: GEDE_UPS
geometry:
{
visible: true
x: 1224.6231150243873
y: 982.9352026187435
width: 145.5
height: 101.0
originalWidth: 145.5
originalHeight: 101.0
folder: false
connector: 2
{
geometry:
{
visible: true
movable: false
specified: false
offsetX: 0.0
offsetY: 0.0
proportionalX: 0.0
proportionalY: 0.0
}
ui:
{
name: com.tomsawyer.editor.ui.TSEDefaultConnectorUI
}
}
}
resize: 0
ui:
{
name: com.smarts.viewer.map.integration.tomsawyer.SmImageNodeUI
borderColor: 0 0 255
drawBorder: true
font: Helvetica-bold-12
textColor: 0 0 255
image: configurableMapIcons/IconMissing.gif
}
}
edge: 67
{
type: 0
INCHARGE-SA-ROSPD
INCHARGE-SA-ROSPD::Cable::LINK-IF-10.112.32.82/1<->PORT-10.112.32.9/1023
LINK-IF-10.112.32.82/1<->PORT-10.112.32.9/1023
Cable
text: LINK-IF-10.112.32.82/1<->PORT-10.112.32.9/1023
source: 1
target: 3
geometry:
{
visible: true
sourceConnector: 2
targetConnector: 4
}
ui:
{
name: com.smarts.viewer.map.integration.tomsawyer.SmPlainEdgeUI
lineColor: 255 0 0
arrowType: 0
}
}
layout:
{
style: circular
respectShapes: true
marginSpacing:
{
proportionalLeftSpacing: 0.0
proportionalRightSpacing: 0.0
proportionalBottomSpacing: 0.0
proportionalTopSpacing: 0.0
constantLeftSpacing: 20.0
constantRightSpacing: 20.0
constantBottomSpacing: 20.0
constantTopSpacing: 20.0
originalConstantLeftSpacing: 20.0
originalConstantRightSpacing: 20.0
originalConstantBottomSpacing: 20.0
originalConstantTopSpacing: 20.0
}
}
tailor:
{
key: layout.glt.orthogonal
{
com.tomsawyer.layout.glt.property.TSBooleanLayoutProperty
{
nameKey: orthogonal.keepNodeSizes
value: true
}
}
key: layout.glt.global
{
com.tomsawyer.layout.glt.property.TSIntLayoutProperty
{
nameKey: global.labelSelection
value: 3
}
}
key: layout.glt.circular
{
com.tomsawyer.layout.glt.property.TSBooleanLayoutProperty
{
nameKey: circular.disableMinNumberOfNodesInCluster
value: true
}
com.tomsawyer.layout.glt.property.TSBooleanLayoutProperty
{
nameKey: circular.disableMaxNumberOfNodesInCluster
value: true
}
com.tomsawyer.layout.glt.property.TSIntLayoutProperty
{
nameKey: circular.proportionalSubsiteClusterRadialSpacing
value: 300
}
com.tomsawyer.layout.glt.property.TSIntLayoutProperty
{
nameKey: circular.proportionalSubsiteClusterTangentialSpacing
value: 300
}
com.tomsawyer.layout.glt.property.TSIntLayoutProperty
{
nameKey: circular.proportionalNodeSpacing
value: 250
}
}
}
ui:
{
name: com.smarts.viewer.map.integration.tomsawyer.SmGraphUI
backgroundColor: 240 248 255
}
}
ZOOM=0.4248693931320715
EndOfSchema
So, have next main blocks.
1) graph
2) topology
3) node
4) edge
5) layout
etc ...
A question is: how can i change only "edge" block?
And needs to take line 3 from edge block like parameter for compare in continue.
P.s
this file have many edge blocks and many node blocks,
So, a question is , how to modify only "edge:" block , for example add lines to edge block after some data manipulation.
I have a question about , how to read block of text file, for example i have a text file in next format:
MR_ManagedObject
true
2
LINK-PORT-10.112.32.73/1003<->PORT-10.112.32.81/8026
Switch
10.112.32.73
Switch
10.112.32.81
TrunkCable
LINK-PORT-10.112.32.73/1003<->PORT-10.112.32.81/8026
TrunkCable
false
1
10.112.32.33
ROSPD-TVE-Vadkov20
Switch
10.112.32.33
graph: 0
{
topology:
{
node: 1
{
type: 0
INCHARGE-SA-ROSPD
INCHARGE-SA-ROSPD::Node::10.112.32.82
0
false
false
10.112.32.82
MR_ManagedObject
0
text: GEDE_UPS
geometry:
{
visible: true
x: 1224.6231150243873
y: 982.9352026187435
width: 145.5
height: 101.0
originalWidth: 145.5
originalHeight: 101.0
folder: false
connector: 2
{
geometry:
{
visible: true
movable: false
specified: false
offsetX: 0.0
offsetY: 0.0
proportionalX: 0.0
proportionalY: 0.0
}
ui:
{
name: com.tomsawyer.editor.ui.TSEDefaultConnectorUI
}
}
}
resize: 0
ui:
{
name: com.smarts.viewer.map.integration.tomsawyer.SmImageNodeUI
borderColor: 0 0 255
drawBorder: true
font: Helvetica-bold-12
textColor: 0 0 255
image: configurableMapIcons/IconMissing.gif
}
}
edge: 67
{
type: 0
INCHARGE-SA-ROSPD
INCHARGE-SA-ROSPD::Cable::LINK-IF-10.112.32.82/1<->PORT-10.112.32.9/1023
LINK-IF-10.112.32.82/1<->PORT-10.112.32.9/1023
Cable
text: LINK-IF-10.112.32.82/1<->PORT-10.112.32.9/1023
source: 1
target: 3
geometry:
{
visible: true
sourceConnector: 2
targetConnector: 4
}
ui:
{
name: com.smarts.viewer.map.integration.tomsawyer.SmPlainEdgeUI
lineColor: 255 0 0
arrowType: 0
}
}
layout:
{
style: circular
respectShapes: true
marginSpacing:
{
proportionalLeftSpacing: 0.0
proportionalRightSpacing: 0.0
proportionalBottomSpacing: 0.0
proportionalTopSpacing: 0.0
constantLeftSpacing: 20.0
constantRightSpacing: 20.0
constantBottomSpacing: 20.0
constantTopSpacing: 20.0
originalConstantLeftSpacing: 20.0
originalConstantRightSpacing: 20.0
originalConstantBottomSpacing: 20.0
originalConstantTopSpacing: 20.0
}
}
tailor:
{
key: layout.glt.orthogonal
{
com.tomsawyer.layout.glt.property.TSBooleanLayoutProperty
{
nameKey: orthogonal.keepNodeSizes
value: true
}
}
key: layout.glt.global
{
com.tomsawyer.layout.glt.property.TSIntLayoutProperty
{
nameKey: global.labelSelection
value: 3
}
}
key: layout.glt.circular
{
com.tomsawyer.layout.glt.property.TSBooleanLayoutProperty
{
nameKey: circular.disableMinNumberOfNodesInCluster
value: true
}
com.tomsawyer.layout.glt.property.TSBooleanLayoutProperty
{
nameKey: circular.disableMaxNumberOfNodesInCluster
value: true
}
com.tomsawyer.layout.glt.property.TSIntLayoutProperty
{
nameKey: circular.proportionalSubsiteClusterRadialSpacing
value: 300
}
com.tomsawyer.layout.glt.property.TSIntLayoutProperty
{
nameKey: circular.proportionalSubsiteClusterTangentialSpacing
value: 300
}
com.tomsawyer.layout.glt.property.TSIntLayoutProperty
{
nameKey: circular.proportionalNodeSpacing
value: 250
}
}
}
ui:
{
name: com.smarts.viewer.map.integration.tomsawyer.SmGraphUI
backgroundColor: 240 248 255
}
}
ZOOM=0.4248693931320715
EndOfSchema
So, have next main blocks.
1) graph
2) topology
3) node
4) edge
5) layout
etc ...
A question is: how can i change only "edge" block?
And needs to take line 3 from edge block like parameter for compare in continue.
P.s
this file have many edge blocks and many node blocks,
So, a question is , how to modify only "edge:" block , for example add lines to edge block after some data manipulation.