<?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 Re: remove zero from values in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097852#M443597</link>
    <description>add following line in your code.&lt;BR /&gt;echo $surface|sed 's/0//g'&lt;BR /&gt;&lt;BR /&gt;Regards, Awadhesh</description>
    <pubDate>Fri, 14 Mar 2008 09:15:35 GMT</pubDate>
    <dc:creator>AwadheshPandey</dc:creator>
    <dc:date>2008-03-14T09:15:35Z</dc:date>
    <item>
      <title>remove zero from values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097851#M443596</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have one file(myfile.txt) that contains values like:&lt;BR /&gt;&lt;BR /&gt;"575129","0.2x0.4","0001","2"&lt;BR /&gt;"575129","0.2x0.4","0002","2"&lt;BR /&gt;"575129","0.4x0.3","0003","2"&lt;BR /&gt;"575129","0.4x0.3","0004","2"&lt;BR /&gt;"575129","0.3x0.4","0005","2"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;i am trying to group values from Field 3 e.g "0002" ....&lt;BR /&gt;&lt;BR /&gt;CODE i am using is :&lt;BR /&gt;&lt;BR /&gt;a=`grep "575129" myfile.txt  | cut -f6 -d'"'`&lt;BR /&gt;surface=`echo $a | awk '{out=$1;for (k=2;k&amp;lt;=NF;k++){out=sprintf("%s,%s",out,$k);}print out}'`&lt;BR /&gt;&lt;BR /&gt;value of surface will be: 00001,00002 ...&lt;BR /&gt;&lt;BR /&gt;i do not want to take 0's means only 1,2,3 ...&lt;BR /&gt;&lt;BR /&gt;Can some one please help me in this regard.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Mar 2008 08:50:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097851#M443596</guid>
      <dc:creator>N Gopal</dc:creator>
      <dc:date>2008-03-14T08:50:32Z</dc:date>
    </item>
    <item>
      <title>Re: remove zero from values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097852#M443597</link>
      <description>add following line in your code.&lt;BR /&gt;echo $surface|sed 's/0//g'&lt;BR /&gt;&lt;BR /&gt;Regards, Awadhesh</description>
      <pubDate>Fri, 14 Mar 2008 09:15:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097852#M443597</guid>
      <dc:creator>AwadheshPandey</dc:creator>
      <dc:date>2008-03-14T09:15:35Z</dc:date>
    </item>
    <item>
      <title>Re: remove zero from values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097853#M443598</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;If I understand you correctly, you&lt;BR /&gt;want a simple result like 1,2,3,4,5,&lt;BR /&gt;&lt;BR /&gt;Many ways to achieve this. One of them&lt;BR /&gt;is by using two standard Shell tools:&lt;BR /&gt;&lt;BR /&gt;sed -e 's/"//g' myfile.txt | awk -F"," '/575129/ {printf("%d,", $3)}'&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;&lt;BR /&gt;VK2COT</description>
      <pubDate>Fri, 14 Mar 2008 09:20:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097853#M443598</guid>
      <dc:creator>VK2COT</dc:creator>
      <dc:date>2008-03-14T09:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: remove zero from values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097854#M443599</link>
      <description>&lt;!--!*#--&gt;&amp;gt; echo $surface|sed 's/0//g'&lt;BR /&gt;&lt;BR /&gt;Brilliant.  Shows thoughtful testing.&lt;BR /&gt;&lt;BR /&gt;dyi # surface='00100'&lt;BR /&gt;dyi # echo $surface | sed 's/0//g'&lt;BR /&gt;1&lt;BR /&gt;&lt;BR /&gt;I'm sure that that's what he wants.&lt;BR /&gt;&lt;BR /&gt;Perhaps you meant something more like this?&lt;BR /&gt;&lt;BR /&gt;echo $surface | sed 's/^0*//'</description>
      <pubDate>Fri, 14 Mar 2008 09:35:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097854#M443599</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-03-14T09:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: remove zero from values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097855#M443600</link>
      <description>Thanks Awadesh,&lt;BR /&gt;&lt;BR /&gt;Your reply solved my problem.&lt;BR /&gt;&lt;BR /&gt;Thanks to all.</description>
      <pubDate>Fri, 14 Mar 2008 10:28:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097855#M443600</guid>
      <dc:creator>N Gopal</dc:creator>
      <dc:date>2008-03-14T10:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: remove zero from values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097856#M443601</link>
      <description>Sorry. I did a mistake.&lt;BR /&gt;&lt;BR /&gt;but you u follow above expert advise of my friend after looking all aspects you will again a looser.&lt;BR /&gt;echo $surface&lt;BR /&gt;0001,0002,0003,0004,00050&lt;BR /&gt;echo $surface | sed 's/^0*//'&lt;BR /&gt;1,0002,0003,0004,00050&lt;BR /&gt;&lt;BR /&gt;the more generic code will be&lt;BR /&gt;echo $surface|sed 's/^0*//g'|sed 's/,0*/,/g'&lt;BR /&gt;&lt;BR /&gt;cheers,&lt;BR /&gt;&lt;BR /&gt;Awadhesh</description>
      <pubDate>Fri, 14 Mar 2008 10:29:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097856#M443601</guid>
      <dc:creator>AwadheshPandey</dc:creator>
      <dc:date>2008-03-14T10:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: remove zero from values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097857#M443602</link>
      <description>I have got solution to my problem.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot.</description>
      <pubDate>Fri, 14 Mar 2008 10:29:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097857#M443602</guid>
      <dc:creator>N Gopal</dc:creator>
      <dc:date>2008-03-14T10:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: remove zero from values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097858#M443603</link>
      <description>Thanks Gopal. I can assume that the person written code below(you)&lt;BR /&gt;&lt;BR /&gt;a=`grep "575129" myfile.txt | cut -f6 -d'"'`&lt;BR /&gt;surface=`echo $a | awk '{out=$1;for (k=2;k&amp;lt;=NF;k++){out=sprintf("%s,%s",out,$k);}print out}'`&lt;BR /&gt;&lt;BR /&gt;can do some testing also and can remove bugs also if it is there in any forum members reply.&lt;BR /&gt;&lt;BR /&gt;:)&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Awadhesh</description>
      <pubDate>Fri, 14 Mar 2008 10:33:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097858#M443603</guid>
      <dc:creator>AwadheshPandey</dc:creator>
      <dc:date>2008-03-14T10:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: remove zero from values</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097859#M443604</link>
      <description>Many Thanka</description>
      <pubDate>Fri, 14 Mar 2008 11:24:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remove-zero-from-values/m-p/5097859#M443604</guid>
      <dc:creator>N Gopal</dc:creator>
      <dc:date>2008-03-14T11:24:15Z</dc:date>
    </item>
  </channel>
</rss>

