<?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: Script help in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343132#M191086</link>
    <description>We can do it with int() function on awk program,&lt;BR /&gt;&lt;BR /&gt; Check the files for .0 with grep as,&lt;BR /&gt;&lt;BR /&gt; while read line; do&lt;BR /&gt;  grep -v "\.0" $line&lt;BR /&gt;  if [[ $? -eq 0 ]]; then&lt;BR /&gt;    echo $line | awk -F "," '{&lt;BR /&gt;    print $1 $2&lt;BR /&gt;    for (i=3;i&lt;NF&gt;&lt;/NF&gt;     print int($i)&lt;BR /&gt;    }'&lt;BR /&gt;  fi&lt;BR /&gt; done &amp;lt; &lt;INPUT-FILE&gt;&lt;/INPUT-FILE&gt;</description>
    <pubDate>Wed, 28 Jul 2004 06:48:27 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2004-07-28T06:48:27Z</dc:date>
    <item>
      <title>Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343129#M191083</link>
      <description>Hi all, I find a script issue and hope u guys can help, suppose I have a output&lt;BR /&gt;&lt;BR /&gt;07/22/2004 11:07:59,LUN 150 [150; RAID 5; hkhpdv11.oocl.com],0.0,0.0,0.0,0.0,0.0&lt;BR /&gt;,0.0,0.0&lt;BR /&gt;07/22/2004 11:12:59,LUN 150 [150; RAID 5; hkhpdv11.oocl.com],0.0,0.0,0.0,0.0,0.0&lt;BR /&gt;,0.0,0.0&lt;BR /&gt;&lt;BR /&gt;which each , represent a field, how can I global delete those .0* field, i.e change all field value to integer? thx. &lt;BR /&gt;&lt;BR /&gt;Gordon</description>
      <pubDate>Wed, 28 Jul 2004 06:14:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343129#M191083</guid>
      <dc:creator>Gordon_3</dc:creator>
      <dc:date>2004-07-28T06:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343130#M191084</link>
      <description>Have you tried sed?&lt;BR /&gt;&lt;BR /&gt; sed -e 's/.0//g' myfile.txt &amp;gt; mynewfile.txt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-denver</description>
      <pubDate>Wed, 28 Jul 2004 06:25:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343130#M191084</guid>
      <dc:creator>Denver Osborn</dc:creator>
      <dc:date>2004-07-28T06:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343131#M191085</link>
      <description>Try this.&lt;BR /&gt;&lt;BR /&gt;cat file|awk -F "]" '{print $1}'&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Wed, 28 Jul 2004 06:29:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343131#M191085</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-07-28T06:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343132#M191086</link>
      <description>We can do it with int() function on awk program,&lt;BR /&gt;&lt;BR /&gt; Check the files for .0 with grep as,&lt;BR /&gt;&lt;BR /&gt; while read line; do&lt;BR /&gt;  grep -v "\.0" $line&lt;BR /&gt;  if [[ $? -eq 0 ]]; then&lt;BR /&gt;    echo $line | awk -F "," '{&lt;BR /&gt;    print $1 $2&lt;BR /&gt;    for (i=3;i&lt;NF&gt;&lt;/NF&gt;     print int($i)&lt;BR /&gt;    }'&lt;BR /&gt;  fi&lt;BR /&gt; done &amp;lt; &lt;INPUT-FILE&gt;&lt;/INPUT-FILE&gt;</description>
      <pubDate>Wed, 28 Jul 2004 06:48:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343132#M191086</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-07-28T06:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343133#M191087</link>
      <description>Possiblly a perl one liner-&lt;BR /&gt; &lt;BR /&gt;perl -p -i -e 's/(\d+)\.\d+/\1/g' yourfile.txt&lt;BR /&gt; &lt;BR /&gt;This will apply the changes directly to "yourfile.txt". If you rather generate a new file with the results-&lt;BR /&gt; &lt;BR /&gt;perl -p -e 's/(\d+)\.\d+/\1/g' yourfile.txt &amp;gt;new_yourfile.txt&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jul 2004 08:51:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343133#M191087</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2004-07-28T08:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343134#M191088</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;thx all for yr help, I find the perl solution do what exactly I want!!  thx all again !&lt;BR /&gt;&lt;BR /&gt;Gordon</description>
      <pubDate>Wed, 28 Jul 2004 20:29:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343134#M191088</guid>
      <dc:creator>Gordon_3</dc:creator>
      <dc:date>2004-07-28T20:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343135#M191089</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;thx all for yr help, I find the perl solution do what exactly I want!!  However, there is still problem that I donno, my input has some line that has "E" extentsion for number. e.g.&lt;BR /&gt;&lt;BR /&gt;07/22/2004 11:52:59     0.0     0.0     4.834483779821818E-6    0.00330034092702&lt;BR /&gt;50276   0.0     0.5     0.0     150&lt;BR /&gt;&lt;BR /&gt;Using the perl script, it give out E-6 as output but not '4', any idea? thx.&lt;BR /&gt;&lt;BR /&gt;Gordon</description>
      <pubDate>Wed, 28 Jul 2004 20:30:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343135#M191089</guid>
      <dc:creator>Gordon_3</dc:creator>
      <dc:date>2004-07-28T20:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343136#M191090</link>
      <description>&lt;BR /&gt;If you want the script to magically match up more number formats then you'll have to teeach it that through a more complex regular expression. In your case it looks like you are only interested in negative Exponentials (E-). You can express that with:&lt;BR /&gt;&lt;BR /&gt;perl -p -e 's/(\d+)\.\d+(E-\d+)?/\1/g' infile &amp;gt; outfile.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What I added to the prio solution was:&lt;BR /&gt;&lt;BR /&gt;(E-\d+)?&lt;BR /&gt;&lt;BR /&gt;That means:&lt;BR /&gt;- a group: ()&lt;BR /&gt;- of E followed by - followed by one or more digits: E-\d+&lt;BR /&gt;- and that group must me present 0 or 1 times to match: ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jul 2004 21:53:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343136#M191090</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-07-28T21:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343137#M191091</link>
      <description>Hi Hein,&lt;BR /&gt;&lt;BR /&gt;Great, this fix the issue, yes I am a newbie for Perl, do donno the syntax of Perl, can u share with me some good source to learn Perl, esp for above line it's a very useful perl one-liner that I must use frequently, but since I donno the syntax, so donno how to modify the "rule"....&lt;BR /&gt;&lt;BR /&gt;thx again.&lt;BR /&gt;&lt;BR /&gt;Gordon</description>
      <pubDate>Wed, 28 Jul 2004 22:41:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343137#M191091</guid>
      <dc:creator>Gordon_3</dc:creator>
      <dc:date>2004-07-28T22:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343138#M191092</link>
      <description>&lt;BR /&gt;I'd recommend the 'camel' books. O'reilly.&lt;BR /&gt;&lt;BR /&gt;Check out:  &lt;A href="http://learn.perl.org/" target="_blank"&gt;http://learn.perl.org/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;and: &lt;A href="http://www.perldoc.com" target="_blank"&gt;www.perldoc.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cheers,&lt;BR /&gt;Hein.  [0 points for this]&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jul 2004 22:59:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343138#M191092</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-07-28T22:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343139#M191093</link>
      <description>Ah, I just remembered. Earlier today a similar question was asked in:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=646837" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=646837&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Check out the 'regular expression' suggestion. Because more then Perl, that's what you need to learn for tasks you describe.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;extracts:&lt;BR /&gt;&lt;BR /&gt;Fred Ruffet   Jul 28, 2004 12:02:11 GMT     &lt;BR /&gt;-------------------------------------------&lt;BR /&gt;Let me tell you I consider the camel book (O'Reilly Perl Reference) as the better book on the subject. Notice that for learning there is also the good Lama Book (O'Reilly Learning Perl). The last editions are are up2date.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;procura   Jul 28, 2004 13:01:01 GMT &lt;BR /&gt;-------------------------------------------&lt;BR /&gt;Even knowing that I am a *real* Perl fanatic, the best book for regular expressions is Jeffrey Friedl's "Mastering Regular Expressions" from O'Reilly&lt;BR /&gt;&lt;BR /&gt;An absolute must for anyone using vi, perl, awk, grep, sh, sed, emacs, ...&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Jul 2004 23:07:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343139#M191093</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2004-07-28T23:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343140#M191094</link>
      <description>Hi Hein,&lt;BR /&gt;&lt;BR /&gt;Sorry , but I cannot find the "camel books", can u pls enlighen, many thx thx.&lt;BR /&gt;&lt;BR /&gt;Gordon</description>
      <pubDate>Thu, 29 Jul 2004 01:20:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343140#M191094</guid>
      <dc:creator>Gordon_3</dc:creator>
      <dc:date>2004-07-29T01:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343141#M191095</link>
      <description>Camel books are the books from O'Reilly that have a Camel on the front and deal with Perl&lt;BR /&gt;&lt;BR /&gt;Start here: &lt;A href="http://www.oreilly.com/catalog/prdindex.html" target="_blank"&gt;http://www.oreilly.com/catalog/prdindex.html&lt;/A&gt;&lt;BR /&gt;browse don to the books starting with "Perl" and find&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.oreilly.com/catalog/pperl3" target="_blank"&gt;http://www.oreilly.com/catalog/pperl3&lt;/A&gt; (the bible. the only true reference, except for the on-line docs of course)&lt;BR /&gt;&lt;A href="http://www.oreilly.com/catalog/lperl3" target="_blank"&gt;http://www.oreilly.com/catalog/lperl3&lt;/A&gt; (the beginner book. Read once and pass on)&lt;BR /&gt;&lt;A href="http://www.oreilly.com/catalog/perlpr4" target="_blank"&gt;http://www.oreilly.com/catalog/perlpr4&lt;/A&gt; (an absolute need. I still use it daily)&lt;BR /&gt;&lt;A href="http://www.oreilly.com/catalog/perlckbk2" target="_blank"&gt;http://www.oreilly.com/catalog/perlckbk2&lt;/A&gt; (the Ram book, a good addition)&lt;BR /&gt;&lt;BR /&gt;Also visit my site to read:&lt;BR /&gt;&lt;BR /&gt;--8&amp;lt;---&lt;BR /&gt;For those that are not (yet) comfortable with Perl, [0]Wendy van Dijk has put up a nice article on [1]use.perl.org titled "Where and how to start learning Perl".&lt;BR /&gt;--&amp;gt;8---&lt;BR /&gt;[0] &lt;A href="http://perlmonks.org/index.pl?node_id=283154" target="_blank"&gt;http://perlmonks.org/index.pl?node_id=283154&lt;/A&gt;&lt;BR /&gt;[1] &lt;A href="http://use.perl.org/" target="_blank"&gt;http://use.perl.org/&lt;/A&gt;&lt;BR /&gt;[2] &lt;A href="http://perlmonks.org/index.pl?node_id=284175" target="_blank"&gt;http://perlmonks.org/index.pl?node_id=284175&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;My HP ITRC site pages can be found at (please use LA as primary choice):&lt;BR /&gt;&lt;BR /&gt;USA Los Angeles &lt;A href="http://mirrors.develooper.com/hpux/" target="_blank"&gt;http://mirrors.develooper.com/hpux/&lt;/A&gt;&lt;BR /&gt;SGP Singapore   &lt;A href="https://www.beepz.com/personal/merijn/" target="_blank"&gt;https://www.beepz.com/personal/merijn/&lt;/A&gt;&lt;BR /&gt;USA Chicago     &lt;A href="http://ww.hpux.ws/merijn/" target="_blank"&gt;http://ww.hpux.ws/merijn/&lt;/A&gt;&lt;BR /&gt;NL  Hoofddorp   &lt;A href="http://www.cmve.net/~merijn/" target="_blank"&gt;http://www.cmve.net/~merijn/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy, have FUN! H.Merijn</description>
      <pubDate>Thu, 29 Jul 2004 01:36:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343141#M191095</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-07-29T01:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343142#M191096</link>
      <description>And Jeffrey's book is also from O'Reilly, so when ordering, tick this one too :)&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.oreilly.com/catalog/regex2" target="_blank"&gt;http://www.oreilly.com/catalog/regex2&lt;/A&gt; (Mastering Regular Expressions)&lt;BR /&gt;&lt;BR /&gt;Don't buy the first edition. It's very outdated now 2nd ed is out!&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Thu, 29 Jul 2004 01:39:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343142#M191096</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-07-29T01:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Script help</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343143#M191097</link>
      <description>Hi Procura, thousand thx!&lt;BR /&gt;&lt;BR /&gt;Gordon</description>
      <pubDate>Thu, 29 Jul 2004 04:40:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help/m-p/3343143#M191097</guid>
      <dc:creator>Gordon_3</dc:creator>
      <dc:date>2004-07-29T04:40:06Z</dc:date>
    </item>
  </channel>
</rss>

