[EMAIL PROTECTED] wrote:

On Mon, Mar 22, 2004 at 02:53:50PM +0000, Tony S. Sykes wrote:


Help, I have my web limited by my company now, so I can't google till tomorrow. I need help with parsing an xml file. I need to cut out a fax number from the file. Easy enough I though just grep and cut the line, but the whole file is one line. I know this is a simple command but I can't work it out on my own, and with out google (strange how easy you get attached to things) I am stuck. Please help.

Thanks,

Tony.



So, assuming the xml fax line was something like


<fax>123-456-7890</fax>




Assuming the same tags as above, this would probably work also:


cat fax.xml | perl -n -e ' print "$1\n" if /<fax>(.+)<\/fax>/; '

HTH,
Carl


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
____________________________________________________
Join the Club : http://www.mandrakeclub.com

Reply via email to