<?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 functionality in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920953#M934580</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;awk is fun but anyway here is another silly one&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cat file|while read line&lt;BR /&gt;do&lt;BR /&gt;f1=$(echo $line|cut -f1 -d":")&lt;BR /&gt;f2=$(echo $line|cut -f2 -d":")&lt;BR /&gt;f2a=$(echo $f2|cut -f1 -d" ")&lt;BR /&gt;f2b=$(echo $f2|cut -f2 -d" ")&lt;BR /&gt;f3=$(echo $line|cut -f3 -d":")&lt;BR /&gt;echo $f2a $f1&lt;BR /&gt;echo $f3 $f2b&lt;BR /&gt;done|sort -n&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;output is&lt;BR /&gt;&lt;BR /&gt;57.07 Execute to Parse %&lt;BR /&gt;70.00 Redo&lt;BR /&gt;96.68 Buffer Hit %&lt;BR /&gt;99.64 Soft&lt;BR /&gt;99.83 In-memory&lt;BR /&gt;99.89 Library Hit %&lt;BR /&gt;99.99 Latch&lt;BR /&gt;100.00 Buffer Nowait %&lt;BR /&gt;&lt;BR /&gt;It is endless&lt;BR /&gt;&lt;BR /&gt;                  Steve steel</description>
    <pubDate>Thu, 06 Mar 2003 14:45:51 GMT</pubDate>
    <dc:creator>Steve Steel</dc:creator>
    <dc:date>2003-03-06T14:45:51Z</dc:date>
    <item>
      <title>script functionality</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920948#M934575</link>
      <description>Hi.&lt;BR /&gt;&lt;BR /&gt;I have a problem whereby I require to extract values from a file. The problem is some lines contain multiple values and I need to retrieve just the first or second value on occasions. &lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;Buffer Nowait %:  100.00 Redo NoWait %:  70.00&lt;BR /&gt;Buffer  Hit  %:   96.68 In-memory Sort %: 99.83&lt;BR /&gt;Library Hit   %: 99.89 Soft Parse %:   99.64&lt;BR /&gt;Execute to Parse %: 57.07 Latch Hit %:   99.99&lt;BR /&gt;&lt;BR /&gt;From this I need to retrieve each value in turn, I am using grep to isolate the row but now I need to extract only the relevant value, e.g. when I need the IN_MEMORY SORT I only want 99.83 and not the entire line.  Similarly when I want BUFFER HIT I want 99.68 and nothing else from the line.&lt;BR /&gt;&lt;BR /&gt;Any ideas?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;Dave&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Mar 2003 14:16:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920948#M934575</guid>
      <dc:creator>Dave Walley</dc:creator>
      <dc:date>2003-03-06T14:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: script functionality</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920949#M934576</link>
      <description>all the numbers :&lt;BR /&gt;&lt;BR /&gt;awk -F': ' '{print $2,$3}' file | awk '{print $1,$NF}'</description>
      <pubDate>Thu, 06 Mar 2003 14:22:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920949#M934576</guid>
      <dc:creator>Tore_1</dc:creator>
      <dc:date>2003-03-06T14:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: script functionality</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920950#M934577</link>
      <description>To get the first value:&lt;BR /&gt;&lt;BR /&gt;cat myfile |awk -F% '{print $2}' |awk '{print $2}'&lt;BR /&gt;&lt;BR /&gt;To get the second value:&lt;BR /&gt;&lt;BR /&gt;cat myfile |awk -F% '{print $2}' |awk '{print $2}'</description>
      <pubDate>Thu, 06 Mar 2003 14:30:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920950#M934577</guid>
      <dc:creator>Colin Topliss</dc:creator>
      <dc:date>2003-03-06T14:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: script functionality</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920951#M934578</link>
      <description>hi&lt;BR /&gt;&lt;BR /&gt;cat file|while read line&lt;BR /&gt;do&lt;BR /&gt;treatment of line&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Then you have the lines 1 by 1 in varaible line.&lt;BR /&gt;&lt;BR /&gt;ex&lt;BR /&gt;&lt;BR /&gt;cat file|while read line&lt;BR /&gt;do&lt;BR /&gt;echo $line|cut -f3 -d":"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;gives only the last field.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;What do you need for format&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;                Steve Steel</description>
      <pubDate>Thu, 06 Mar 2003 14:36:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920951#M934578</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2003-03-06T14:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: script functionality</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920952#M934579</link>
      <description>a5:/tmp 110 &amp;gt; cat xx                                                            Buffer Nowait %: 100.00 Redo NoWait %: 70.00&lt;BR /&gt;Buffer Hit %: 96.68 In-memory Sort %: 99.83&lt;BR /&gt;Library Hit %: 99.89 Soft Parse %: 99.64&lt;BR /&gt;Execute to Parse %: 57.07 Latch Hit %: 99.99&lt;BR /&gt;a5:/tmp 111 &amp;gt; perl -nle'BEGIN{$pat=shift}/\s*([a-z_. -]*?$pat[\w%:. -]*?[\d.]+)/i&amp;amp;&amp;amp;print$1' memory xx&lt;BR /&gt;In-memory Sort %: 99.83&lt;BR /&gt;a5:/tmp 112 &amp;gt; perl -nle'BEGIN{$pat=shift}/\s*([a-z_. -]*?$pat[\w%:. -]*?[\d.]+)/i&amp;amp;&amp;amp;print$1' parse xx&lt;BR /&gt;Soft Parse %: 99.64&lt;BR /&gt;Execute to Parse %: 57.07&lt;BR /&gt;a5:/tmp 113 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;you can allways turn this into a script :)&lt;BR /&gt;&lt;BR /&gt;Enjoy, have FUN! H.Merijn</description>
      <pubDate>Thu, 06 Mar 2003 14:44:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920952#M934579</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-03-06T14:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: script functionality</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920953#M934580</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;awk is fun but anyway here is another silly one&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cat file|while read line&lt;BR /&gt;do&lt;BR /&gt;f1=$(echo $line|cut -f1 -d":")&lt;BR /&gt;f2=$(echo $line|cut -f2 -d":")&lt;BR /&gt;f2a=$(echo $f2|cut -f1 -d" ")&lt;BR /&gt;f2b=$(echo $f2|cut -f2 -d" ")&lt;BR /&gt;f3=$(echo $line|cut -f3 -d":")&lt;BR /&gt;echo $f2a $f1&lt;BR /&gt;echo $f3 $f2b&lt;BR /&gt;done|sort -n&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;output is&lt;BR /&gt;&lt;BR /&gt;57.07 Execute to Parse %&lt;BR /&gt;70.00 Redo&lt;BR /&gt;96.68 Buffer Hit %&lt;BR /&gt;99.64 Soft&lt;BR /&gt;99.83 In-memory&lt;BR /&gt;99.89 Library Hit %&lt;BR /&gt;99.99 Latch&lt;BR /&gt;100.00 Buffer Nowait %&lt;BR /&gt;&lt;BR /&gt;It is endless&lt;BR /&gt;&lt;BR /&gt;                  Steve steel</description>
      <pubDate>Thu, 06 Mar 2003 14:45:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920953#M934580</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2003-03-06T14:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: script functionality</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920954#M934581</link>
      <description>Since Opera ruined my newlines anyway, here's the script approach:&lt;BR /&gt;&lt;BR /&gt;a5:/tmp 117 &amp;gt; cat xx&lt;BR /&gt;Buffer Nowait %: 100.00 Redo NoWait %: 70.00&lt;BR /&gt;Buffer Hit %: 96.68 In-memory Sort %: 99.83&lt;BR /&gt;Library Hit %: 99.89 Soft Parse %: 99.64&lt;BR /&gt;Execute to Parse %: 57.07 Latch Hit %: 99.99&lt;BR /&gt;a5:/tmp 118 &amp;gt; cat xx.pl&lt;BR /&gt;#!/usr/bin/perl -l&lt;BR /&gt;$pat = shift;&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;    /\s*([a-z_. -]*?$pat[\w%:. -]*?[\d.]+)/i &amp;amp;&amp;amp; print $1;&lt;BR /&gt;    }&lt;BR /&gt;a5:/tmp 119 &amp;gt; xx.pl memory xx&lt;BR /&gt;In-memory Sort %: 99.83&lt;BR /&gt;a5:/tmp 120 &amp;gt; xx.pl parse xx&lt;BR /&gt;Soft Parse %: 99.64&lt;BR /&gt;Execute to Parse %: 57.07&lt;BR /&gt;a5:/tmp 121 &amp;gt; xx.pl soft xx&lt;BR /&gt;Soft Parse %: 99.64&lt;BR /&gt;a5:/tmp 122 &amp;gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy, have FUN! H.Merijn</description>
      <pubDate>Thu, 06 Mar 2003 14:51:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920954#M934581</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-03-06T14:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: script functionality</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920955#M934582</link>
      <description>Hi Dave,&lt;BR /&gt;&lt;BR /&gt;Here's another awk solution:&lt;BR /&gt;&lt;BR /&gt;Create an awk script:&lt;BR /&gt;&lt;BR /&gt;=======================&lt;BR /&gt;$0 ~ var{&lt;BR /&gt;p=index($0,var)&lt;BR /&gt;for (i=p+length(var)+4;i&lt;LENGTH&gt;&lt;/LENGTH&gt;{printf substr($0,i,1)}&lt;BR /&gt;}END{print}&lt;BR /&gt;=======================&lt;BR /&gt;&lt;BR /&gt;then run using:&lt;BR /&gt;&lt;BR /&gt;# awk -f awkscript var="Soft Parse" yourfile&lt;BR /&gt;99.64&lt;BR /&gt;&lt;BR /&gt;# awk -f awkscript var="Buffer Nowait" yourfile&lt;BR /&gt;100.00&lt;BR /&gt;&lt;BR /&gt;rgds, Robin</description>
      <pubDate>Thu, 06 Mar 2003 15:12:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-functionality/m-p/2920955#M934582</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2003-03-06T15:12:53Z</dc:date>
    </item>
  </channel>
</rss>

