I have a xml file that I need to modify 1 line to change some value from 2 to 10 (or any number).
Sample input:
Basically, I only need to update the max-value from 2 to any number (i.e. 10). However, there are multiple occurrences of the ff line in the xml.
The only unique line that can be used as pattern is '<message:test name="ryan">'
Is there a sed or awk command that can be used to update the max-value?
Hello brichigo,
Following may help, lets say our input file is as follows.
Then code is as follows.
Output will be as follows.
Just taken example as per your guven input. So kindly let me know if this helps.
I'm trying to write a perl script that I can run as a cron job in root of my web server that will look for .shtml files get their last modified date and replace it in the sitemap_test.xml file. the problem is the substitution doesn't work and when I print to MYFILE it adds the lastmod to the end of... (3 Replies)
Dear all,
I'm trying to write a script where:
A file contains more or less 2000 lines. To some of those lines, in a specific position, let's say 89-92 there are spaces. So, this script should find these spaces on specific position and update a value (from 2 to 1) to another position of the... (4 Replies)
Hi experts,
I have a set of xml files in folder which has the below field.
<mm:sessionID>157.235.206.12900397BE4:A</mm:sessionID>,
I need to update this field regularly with new session id, which I have it from a login file.
Can anyone tell me how to add a new value in <mm:sessionID>... (3 Replies)
I am not sure how to approach this find/replace using a shell script. Any help or guidance appreciated.
I want to find this:
<objects/>
<thumb>thumb_0001.jpg</thumb>
<preview>preview_0001.jpg</preview>
And replace with something like this:
<objects>... (1 Reply)
Hello,
I have an xml file whose contacts are like below:
<Node>Apple
<B>Value1</B>
<B>Value2</B>
<B>Value3</B>
</Node>
<Node>Mango
<B>Value1</B>
<B>Value2</B>
<B>Value3</B>
</Node>
<Node>Apple
<B>Value1</B>
<B>Value2</B>
<B>Value3</B>
</Node>
<Node>Bannana (3 Replies)
Hi....I have a xml file which is having lots of special characters which I need to find out and put the distinct list of those into a text file. The list of special characters is not specific, it can be anything at different point of time.
Can anyone help me to find out the same and list out?
... (10 Replies)
Hello,
I have a XML file and need to update the data for a specific XML Attribute in the file. I need a Perl or Awk command to look for <INTERCHANGE_CONTROL_NO>000000601</INTERCHANGE_CONTROL_NO>
in the XML file and change the first two 0 of the value to 9.
For instance ... (4 Replies)
Good Day All
Im quiet new to ksh scripting and need a bit of your help. I am attempting to write a script that reads in an XML and extracts certain field values from an XML file. The values are all alphanumeric and consist of two components: e.g "Test 1".
I need to to create a script that... (2 Replies)
Below is the content in my XML file
<name>XXX</name>
<eventType>Uptime</eventType>
<eventType>Delay</eventType>
<eventType>Delay</eventType>
<name>YYY</name>
<eventType>Uptime</eventType>
<eventType>Delay</eventType>
... (12 Replies)