<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic find and replace string in xml files in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252046#M331702</link>
    <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I have 5 xml contains string:&lt;BR /&gt;&lt;BR /&gt;&lt;EASTING&gt;040164.40&lt;/EASTING&gt;&lt;BR /&gt;&lt;NORTHING&gt;020383.20&lt;/NORTHING&gt;&lt;BR /&gt;&lt;BR /&gt;Values of tags may differ in files. I want the output&lt;BR /&gt;like (after desimal only 2 zeros)&lt;BR /&gt;&lt;EASTING&gt;401644.00&lt;/EASTING&gt;&lt;BR /&gt;&lt;NORTHING&gt;203832.00&lt;/NORTHING&gt;&lt;BR /&gt;&lt;BR /&gt;We need program or command that will go each file find these tags(Easting and Northing and update the entry).&lt;BR /&gt;&lt;BR /&gt;Can some one help me in this regard?&lt;BR /&gt;&lt;BR /&gt;Thanks..</description>
    <pubDate>Thu, 14 Aug 2008 09:50:30 GMT</pubDate>
    <dc:creator>diwakar_4</dc:creator>
    <dc:date>2008-08-14T09:50:30Z</dc:date>
    <item>
      <title>find and replace string in xml files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252046#M331702</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I have 5 xml contains string:&lt;BR /&gt;&lt;BR /&gt;&lt;EASTING&gt;040164.40&lt;/EASTING&gt;&lt;BR /&gt;&lt;NORTHING&gt;020383.20&lt;/NORTHING&gt;&lt;BR /&gt;&lt;BR /&gt;Values of tags may differ in files. I want the output&lt;BR /&gt;like (after desimal only 2 zeros)&lt;BR /&gt;&lt;EASTING&gt;401644.00&lt;/EASTING&gt;&lt;BR /&gt;&lt;NORTHING&gt;203832.00&lt;/NORTHING&gt;&lt;BR /&gt;&lt;BR /&gt;We need program or command that will go each file find these tags(Easting and Northing and update the entry).&lt;BR /&gt;&lt;BR /&gt;Can some one help me in this regard?&lt;BR /&gt;&lt;BR /&gt;Thanks..</description>
      <pubDate>Thu, 14 Aug 2008 09:50:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252046#M331702</guid>
      <dc:creator>diwakar_4</dc:creator>
      <dc:date>2008-08-14T09:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: find and replace string in xml files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252047#M331703</link>
      <description>This might do it&lt;BR /&gt;&lt;BR /&gt;sed '/&lt;EASTING&gt;.*&amp;lt;\/Easting&amp;gt;/s/\.../\.00/g' filename &amp;gt; filename.new&lt;BR /&gt;&lt;BR /&gt;repeat by replacing "East" with "North" and keeping track of the intermediate files. If you have more lines that start and end the same way but don't have numbers in them you need to narrow down the search string to numbers only.&lt;/EASTING&gt;</description>
      <pubDate>Thu, 14 Aug 2008 10:51:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252047#M331703</guid>
      <dc:creator>TTr</dc:creator>
      <dc:date>2008-08-14T10:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: find and replace string in xml files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252048#M331704</link>
      <description>If you only want to change the lines with Easting and Northing, you can do:&lt;BR /&gt;sed -e 's:\(&lt;EASTING&gt;.*\.\)..\(&lt;/EASTING&gt;\):\100\2:' \&lt;BR /&gt;-e 's:\(&lt;NORTHING&gt;.*\.\)..\(&lt;/NORTHING&gt;\):\100\2:' filename&lt;BR /&gt;&lt;BR /&gt;If you want to change all numbers to have .00, that's easier.</description>
      <pubDate>Fri, 15 Aug 2008 06:29:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252048#M331704</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-08-15T06:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: find and replace string in xml files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252049#M331705</link>
      <description>Hi Dennis and Ttr,&lt;BR /&gt;Many thanks,&lt;BR /&gt;&lt;BR /&gt;It is looks quite ok but what it is doing is :&lt;BR /&gt;&lt;BR /&gt;&lt;EASTING&gt;040164.40&lt;/EASTING&gt; changing to&lt;BR /&gt;&lt;BR /&gt;&lt;EASTING&gt;040164.00&lt;/EASTING&gt; i want out put like&lt;BR /&gt;&lt;EASTING&gt;0401644.00&lt;/EASTING&gt;. Could you please suggest on this.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 18 Aug 2008 04:59:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252049#M331705</guid>
      <dc:creator>diwakar_4</dc:creator>
      <dc:date>2008-08-18T04:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: find and replace string in xml files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252050#M331706</link>
      <description>&amp;gt;but what it is doing is&lt;BR /&gt;&lt;BR /&gt;Oops, I didn't notice you multiplied by 10.&lt;BR /&gt;&lt;BR /&gt;sed -e 's:\(&lt;EASTING&gt;.*\.\(.\)0\(&lt;/EASTING&gt;\):\1\2.00\3:' \&lt;BR /&gt;-e 's:\(&lt;NORTHING&gt;.*\.\(.\)0\(&lt;/NORTHING&gt;\):\1\2.00\3:' filename</description>
      <pubDate>Mon, 18 Aug 2008 12:18:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252050#M331706</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-08-18T12:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: find and replace string in xml files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252051#M331707</link>
      <description>Hi Diwakar,&lt;BR /&gt;&lt;BR /&gt;It is a kind of "patch work". But this is what comes to my mind now - and it works. Try with different source files to make sure the result is correct:&lt;BR /&gt;&lt;BR /&gt;cat filename&lt;BR /&gt;&lt;EASTING&gt;040167.40&lt;/EASTING&gt;&lt;BR /&gt;&lt;EASTING&gt;090968.70&lt;/EASTING&gt;&lt;BR /&gt;&lt;EASTING&gt;00240164.90&lt;/EASTING&gt;&lt;BR /&gt;&lt;NORTHING&gt;0920383.80&lt;/NORTHING&gt;&lt;BR /&gt;&lt;SOUTHING&gt;0170381.20&lt;/SOUTHING&gt;&lt;BR /&gt;&lt;BR /&gt;sed 's/\.//g' filename|awk -F"0&lt;BR /&gt;&lt;BR /&gt;&lt;EASTING&gt;0401674.00&lt;/EASTING&gt;&lt;BR /&gt;&lt;EASTING&gt;0909687.00&lt;/EASTING&gt;&lt;BR /&gt;&lt;EASTING&gt;002401649.00&lt;/EASTING&gt;&lt;BR /&gt;&lt;NORTHING&gt;09203838.00&lt;/NORTHING&gt;&lt;BR /&gt;&lt;SOUTHING&gt;01703812.00&lt;/SOUTHING&gt;&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Mon, 18 Aug 2008 12:37:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252051#M331707</guid>
      <dc:creator>Rasheed Tamton</dc:creator>
      <dc:date>2008-08-18T12:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: find and replace string in xml files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252052#M331708</link>
      <description>Oops, a slight typo, a missing \):&lt;BR /&gt;sed -e 's:\(&lt;EASTING&gt;.*\)\.\(.\)0\(&lt;/EASTING&gt;\):\1\2.00\3:' \&lt;BR /&gt;          -e 's:\(&lt;NORTHING&gt;.*\)\.\(.\)0\(&lt;/NORTHING&gt;\):\1\2.00\3:'&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Aug 2008 23:25:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252052#M331708</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-08-18T23:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: find and replace string in xml files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252053#M331709</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot it works for me. But i struck in one place where i want to regular expression with if condition like&lt;BR /&gt;&lt;BR /&gt;var=13&lt;BR /&gt;if [ $var [1-9]0 ] ; then&lt;BR /&gt;&lt;BR /&gt;echo " required no contains first digit between 1-9 and followed by 0 "&lt;BR /&gt;&lt;BR /&gt;else&lt;BR /&gt;&lt;BR /&gt;echo " num does not follow patterns "&lt;BR /&gt;&lt;BR /&gt;fi;&lt;BR /&gt;&lt;BR /&gt;Please suggest correct way to right this.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot</description>
      <pubDate>Tue, 19 Aug 2008 06:20:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252053#M331709</guid>
      <dc:creator>diwakar_4</dc:creator>
      <dc:date>2008-08-19T06:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: find and replace string in xml files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252054#M331710</link>
      <description>&lt;!--!*#--&gt;&amp;gt;But I struck in one place where I want to regular expression with if condition like&lt;BR /&gt;&lt;BR /&gt;To handle file matching patterns you can do:&lt;BR /&gt;for var in 13 20; do&lt;BR /&gt;   if [[ "$var" = [1-9]0 ]]; then&lt;BR /&gt;      echo "$var: matches pattern"&lt;BR /&gt;   else&lt;BR /&gt;      echo "$var: doesn't match"&lt;BR /&gt;   fi&lt;BR /&gt;done</description>
      <pubDate>Tue, 19 Aug 2008 07:18:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252054#M331710</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-08-19T07:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: find and replace string in xml files</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252055#M331711</link>
      <description>Hi Dennis,&lt;BR /&gt;&lt;BR /&gt;Thanks a ton,&lt;BR /&gt;&lt;BR /&gt;It is working.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 19 Aug 2008 07:23:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-and-replace-string-in-xml-files/m-p/4252055#M331711</guid>
      <dc:creator>diwakar_4</dc:creator>
      <dc:date>2008-08-19T07:23:40Z</dc:date>
    </item>
  </channel>
</rss>

