how to find and read out parms in an xml file
hello !
I have for example following xml file content: <blabla>..<blabla/><blabla>..<blabla/><parm1>10</parm1><parm2>20<parm2/><blabla>..<blabla/><blabla>..<blabla/> know I would like using grep or find or awk catch the parm 2 (20) by finding the value of parm 1 (10) first and displaying (print) parm 2 secondly. Thanks in advance br, mcandy |
Hi,
And welcome to LQ! I'm not sure what the requirement is; is the name of the tag relevant at all, or are you just looking for the first piece of VALUE after a value of 10? [edit] If my trivial assumption above was correct this simple sed below would do: Code:
Cheers, Tink |
Quote:
First of all, thanks for the reply ! my string looks like following: long part befor in this string...<dscpService>0</dscpService><Enable>1</Enable>...long part afterwards So, I should find first the tag <dscpService>0</dscpService> , which is uniq in this xml file and direct afterwards comes the Enable Flag which could be 0=off or 1=on. So I need to read the Enable flag or to define it in a parm. hope thats a better description, br, mcandy |
All times are GMT -5. The time now is 08:10 AM. |