sub strings extraction from multiline output
Posted: 07 Jan 2014 10:48
i request you to please help to extract the sub strings from the multiline output. Thanks in advance
we have a command in MQ in display the channel status. that command display the status of different types of channels ( SVRCONN/CLUSSDR/CLUSRCVR/SDR/RCVR). all the types channels does not have all common properties. only few of the properties are common. i want to extract the value of property.
command :
dis chs(*) chltype chstada chstati msgs sslpeer
The above command displays the data in below format.( in multiple lines). here i have written sample outputs.
CHANNEL(ABCD) CHLTYPE(SVRCONN)
CHSTADA(10-12-2013) CHSTATI(10:20:30)
connAME(10.20.30.40) STATUS(RETRYING)
msgs(1009) sslpeer(kjhdsfkjsd)
substate(Recive)
CHANNEL(DEFG) CHLTYPE(SDR)
CHSTADA(10-12-2013) CHSTATI(10:20:30)
connAME(10.20.30.40) STATUS(RETRYING)
substate(MQGet) msgs(10020)
sslpeer(kjhdsfkjsdfhjkshfjksfdhsjdfhsfsdhjfhsdjfhjkfhhfkfjkhfjkdsjfsdjkhdsjkfhsdjkfhdskjfhkj)
XMITQ(ABCD.TEST)
CHANNEL(GHIJ) CHLTYPE(CLUSRCVR)
CHSTADA(10-12-2013) CHSTATI(10:20:30)
connAME(10.20.30.40) STATUS(RETRYING)
current mcauser(ahghj)
substate(Recive) sslpeer(kjhdsfkjsdfhjkshfjkjkhdsjkfhsdjkfhdskjfhkj)
i want to extract the property values
channel | chltype | chstada |chstati |status |msgs |sslpeer
ABCD | SVRCONN | 10-12-2013| 10:20:30|running|1009| kjhdsfkjsd
DEFG | SVRCONN | 10-12-2013| 10:20:30|running|1009| kjhdsfkjsd
GHIJwewe | SVRCONN | 10-12-2013| 10:20:30|running|1009| kjhdsfkjsd
some channels have some extra properties and may not end all type channels with same property. for example SDR channel having extra property xmitq. but all the channels display start with channel name.
The proprty value may not standard length and position. it varies from channel to channel. suppose channel name can have max allowed upto 20 chars..
could you please some one guide me on this. with the below thread solution i tried ....
viewtopic.php?f=3&t=5227
we have a command in MQ in display the channel status. that command display the status of different types of channels ( SVRCONN/CLUSSDR/CLUSRCVR/SDR/RCVR). all the types channels does not have all common properties. only few of the properties are common. i want to extract the value of property.
command :
dis chs(*) chltype chstada chstati msgs sslpeer
The above command displays the data in below format.( in multiple lines). here i have written sample outputs.
CHANNEL(ABCD) CHLTYPE(SVRCONN)
CHSTADA(10-12-2013) CHSTATI(10:20:30)
connAME(10.20.30.40) STATUS(RETRYING)
msgs(1009) sslpeer(kjhdsfkjsd)
substate(Recive)
CHANNEL(DEFG) CHLTYPE(SDR)
CHSTADA(10-12-2013) CHSTATI(10:20:30)
connAME(10.20.30.40) STATUS(RETRYING)
substate(MQGet) msgs(10020)
sslpeer(kjhdsfkjsdfhjkshfjksfdhsjdfhsfsdhjfhsdjfhjkfhhfkfjkhfjkdsjfsdjkhdsjkfhsdjkfhdskjfhkj)
XMITQ(ABCD.TEST)
CHANNEL(GHIJ) CHLTYPE(CLUSRCVR)
CHSTADA(10-12-2013) CHSTATI(10:20:30)
connAME(10.20.30.40) STATUS(RETRYING)
current mcauser(ahghj)
substate(Recive) sslpeer(kjhdsfkjsdfhjkshfjkjkhdsjkfhsdjkfhdskjfhkj)
i want to extract the property values
channel | chltype | chstada |chstati |status |msgs |sslpeer
ABCD | SVRCONN | 10-12-2013| 10:20:30|running|1009| kjhdsfkjsd
DEFG | SVRCONN | 10-12-2013| 10:20:30|running|1009| kjhdsfkjsd
GHIJwewe | SVRCONN | 10-12-2013| 10:20:30|running|1009| kjhdsfkjsd
some channels have some extra properties and may not end all type channels with same property. for example SDR channel having extra property xmitq. but all the channels display start with channel name.
The proprty value may not standard length and position. it varies from channel to channel. suppose channel name can have max allowed upto 20 chars..
could you please some one guide me on this. with the below thread solution i tried ....
viewtopic.php?f=3&t=5227