Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: get data in...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 10 Topic 2214 of 2341
Post > Topic >>

Re: get data in xml do***ent

by Hermann Peifer <peifer@[EMAIL PROTECTED] > Apr 2, 2008 at 08:23 AM

On Apr 2, 4:00 pm, Patrick <patrick.mor...@[EMAIL PROTECTED]
> wrote:
> hi to all,
> i've a xml do***ent as:
> <?xml version="1.0"?>
> <!DOCTYPE ElencoNomi>
> <ElencoNomi>
>  <!-- commento -->
>  <!-- -->
>  <!-- commento  -->
>
> <ch:names>
>         <ch:name>one</ch:name>
>         <ch:name>two</ch:name>
>         <ch:name>freel</ch:name>
>         <ch:name>four</ch:name>
>         <ch:name>five</ch:name>
>         <ch:name>six</ch:name>
>         <ch:name>seven</ch:name>
> </ch:names>
> </ElencoNomi>
>
> i would get the word between <ch:name> and </ch:name>.
> how can i do the get it in awk?
> thanks

One dirty quick hack would be: awk -F'[<>]' '/<ch:name>/{print $3}'

This does not work if the "word" contains a ">" character.

Hermann
 




 10 Posts in Topic:
get data in xml document
Patrick <patrick.mores  2008-04-02 07:00:42 
Re: get data in xml document
Hermann Peifer <peifer  2008-04-02 08:23:04 
Re: get data in xml document
pk <pk@[EMAIL PROTECTE  2008-04-02 17:39:03 
Re: get data in xml document
pk <pk@[EMAIL PROTECTE  2008-04-02 17:38:45 
Re: get data in xml document
Ed Morton <morton@[EMA  2008-04-02 10:28:30 
OT: get data in xml document
Hermann Peifer <peifer  2008-04-02 08:47:11 
Re: OT: get data in xml document
pk <pk@[EMAIL PROTECTE  2008-04-02 18:14:45 
Re: get data in xml document
Hermann Peifer <peifer  2008-04-02 08:55:53 
Re: get data in xml document
Ed Morton <morton@[EMA  2008-04-02 15:01:05 
Re: get data in xml document
Hermann Peifer <peifer  2008-04-03 19:53:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Aug 27 18:05:46 CDT 2008.