Colin_R has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks!
I am trying to edit an .xml file, the most relevant field of which is generally indicated by body="..."
In cases where the body content contains quotation marks, the format changes to body=' ...".." ...'
body= is always the sixth field, so that its content is preceded by five matched pairs of fieldname="..."
I would be grateful for any hints on how to harvest the body content.
Thank you,
Colin
p.s. my current awk one-liner fails to recognise the body='...' demarcator:
awk -F \" '{print $12}' < infile.xml > outfile.xml
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: conditional input field separator?
by ww (Archbishop) on Feb 10, 2012 at 12:52 UTC | |
by Colin_R (Initiate) on Feb 10, 2012 at 13:15 UTC | |
by ww (Archbishop) on Feb 10, 2012 at 13:19 UTC | |
by Colin_R (Initiate) on Feb 10, 2012 at 18:21 UTC | |
|
Re: conditional input field separator?
by JavaFan (Canon) on Feb 10, 2012 at 12:09 UTC | |
by Colin_R (Initiate) on Feb 10, 2012 at 13:14 UTC | |
|
Re: conditional input field separator?
by choroba (Cardinal) on Feb 10, 2012 at 15:54 UTC |