<?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 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2522153#M878199</link>
    <description>#split -l 14 log.txt&lt;BR /&gt;#grep -l "uti = 102" x*&lt;BR /&gt;output is xaa,xac,etc.&lt;BR /&gt;#grep -E "uti|mnemo|sens|qte|prix" xaa|grep -v "uti_cmd"&lt;BR /&gt;#grep -E "uti|mnemo|sens|qte|prix" xac|grep -v "uti_cmd"&lt;BR /&gt;</description>
    <pubDate>Fri, 27 Apr 2001 13:55:42 GMT</pubDate>
    <dc:creator>Vincenzo Restuccia</dc:creator>
    <dc:date>2001-04-27T13:55:42Z</dc:date>
    <item>
      <title>script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2522149#M878195</link>
      <description>I want to select mnemo,sens,qte,prix from the log file where Uti = 102. How to write that script? The output should look like.&lt;BR /&gt;&lt;BR /&gt;uti = 102,&lt;BR /&gt;mnemo = 223                 ,&lt;BR /&gt;sens = 0,&lt;BR /&gt;qte = 400000,&lt;BR /&gt;prix = 56.750000,&lt;BR /&gt;uti = 102,&lt;BR /&gt;mnemo = 210                 ,&lt;BR /&gt;sens = 0,&lt;BR /&gt;qte = 400000,&lt;BR /&gt;prix = 56.800000,</description>
      <pubDate>Fri, 27 Apr 2001 06:36:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2522149#M878195</guid>
      <dc:creator>Godfrey</dc:creator>
      <dc:date>2001-04-27T06:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2522150#M878196</link>
      <description>That is quick and dirty: &lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;&lt;BR /&gt;for i in `grep -n  "uti = 102" logfile | cut -f1 -d:`&lt;BR /&gt;do&lt;BR /&gt;i=`expr $i + 13`&lt;BR /&gt;head -n $i logfilename | tail -13 |grep -e "uti =" /&lt;BR /&gt;-e mnemo -e sens -e qte -e prix&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This assumes that one record is always 13 lines long. I bet you will see some nice awk scripts later. :) &lt;BR /&gt;&lt;BR /&gt;Carsten</description>
      <pubDate>Fri, 27 Apr 2001 07:03:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2522150#M878196</guid>
      <dc:creator>Carsten Krege</dc:creator>
      <dc:date>2001-04-27T07:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2522151#M878197</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;here my awk script :-)&lt;BR /&gt;&lt;BR /&gt;awk -vUTI_SELECT=102 'BEGIN{valid=0;}&lt;BR /&gt;{&lt;BR /&gt;if($1 == "uti" &amp;amp;&amp;amp; int($3) == UTI_SELECT)&lt;BR /&gt;  valid=1;&lt;BR /&gt;if(valid == 1)&lt;BR /&gt;{&lt;BR /&gt;  if($1 == "uti")&lt;BR /&gt;    print $0;&lt;BR /&gt;  else if($1 == "mnemo")&lt;BR /&gt;    print $1 " " $2 " " $3 " " $4;&lt;BR /&gt;  else if($1 == "sens")&lt;BR /&gt;    print $0;&lt;BR /&gt;  else if($1 == "qte")&lt;BR /&gt;    print $0;&lt;BR /&gt;  else if($1 == "prix")&lt;BR /&gt;  {&lt;BR /&gt;    print $0;&lt;BR /&gt;    valid=0;&lt;BR /&gt;  }&lt;BR /&gt;}&lt;BR /&gt;}' &lt;FILE&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;/FILE&gt;</description>
      <pubDate>Fri, 27 Apr 2001 07:19:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2522151#M878197</guid>
      <dc:creator>Andreas Voss</dc:creator>
      <dc:date>2001-04-27T07:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2522152#M878198</link>
      <description>&lt;BR /&gt;I whish you like this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;sed -e 's/-/#/g                                                                                                                     &lt;BR /&gt;s/ //g                                                                                                                              &lt;BR /&gt;s/,/ /' file &amp;gt;  file1                                                                                                               &lt;BR /&gt;                                                                                                                                    &lt;BR /&gt;awk  ' BEGIN{RS="#"}   # set field separator to "#                                                                                  &lt;BR /&gt;#                                                                                                                                   &lt;BR /&gt;length($0) &amp;gt;0  {                                                                                                                    &lt;BR /&gt;        for (i=1; i&lt;NF&gt;&lt;/NF&gt;        {                                                                                                                           &lt;BR /&gt;        printf "[ %s ]",$i                                                                                                          &lt;BR /&gt;        }                                                                                                                           &lt;BR /&gt; printf "\n" }' file1  &lt;BR /&gt;</description>
      <pubDate>Fri, 27 Apr 2001 08:36:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2522152#M878198</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2001-04-27T08:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2522153#M878199</link>
      <description>#split -l 14 log.txt&lt;BR /&gt;#grep -l "uti = 102" x*&lt;BR /&gt;output is xaa,xac,etc.&lt;BR /&gt;#grep -E "uti|mnemo|sens|qte|prix" xaa|grep -v "uti_cmd"&lt;BR /&gt;#grep -E "uti|mnemo|sens|qte|prix" xac|grep -v "uti_cmd"&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Apr 2001 13:55:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2522153#M878199</guid>
      <dc:creator>Vincenzo Restuccia</dc:creator>
      <dc:date>2001-04-27T13:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2522154#M878200</link>
      <description>How about a line of Perl for a change? ;-)&lt;BR /&gt;&lt;BR /&gt;# perl -e 'while (&amp;lt;&amp;gt;){print if /uti\s+=\s+102,/../Dval/}'  /path/to/raw_data</description>
      <pubDate>Sun, 29 Apr 2001 22:09:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script/m-p/2522154#M878200</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2001-04-29T22:09:49Z</dc:date>
    </item>
  </channel>
</rss>

