<?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: Question about script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008691#M911229</link>
    <description>Try:&lt;BR /&gt;&lt;BR /&gt;grep -E 'class|date' input_file &amp;gt; output_file&lt;BR /&gt;&lt;BR /&gt;Kenneth</description>
    <pubDate>Thu, 26 Jun 2003 12:41:39 GMT</pubDate>
    <dc:creator>Kenneth_19</dc:creator>
    <dc:date>2003-06-26T12:41:39Z</dc:date>
    <item>
      <title>Question about script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008690#M911228</link>
      <description>Hi....wondering if you could help....&lt;BR /&gt;i have a file with block of approx 20 lines similar to the below, repeated 100's of times througout the file:&lt;BR /&gt;&lt;BR /&gt;type:              114&lt;BR /&gt;id:               3&lt;BR /&gt;version:                  3&lt;BR /&gt;date:            2003-06-25 10:30:55&lt;BR /&gt;node:             0&lt;BR /&gt;application:           0&lt;BR /&gt;length:           75345&lt;BR /&gt;class:            234&lt;BR /&gt;service:             0&lt;BR /&gt;content:       0&lt;BR /&gt;report:          0&lt;BR /&gt;timer:               0&lt;BR /&gt;count time:     0&lt;BR /&gt;input field:  0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The problem i that I need to output the line listed "class" and the line listed "date" together to a seperate file. I need this to be repeated from each block of 20 lines throughout the file. Any ideas?&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 26 Jun 2003 12:38:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008690#M911228</guid>
      <dc:creator>Anthony_69</dc:creator>
      <dc:date>2003-06-26T12:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Question about script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008691#M911229</link>
      <description>Try:&lt;BR /&gt;&lt;BR /&gt;grep -E 'class|date' input_file &amp;gt; output_file&lt;BR /&gt;&lt;BR /&gt;Kenneth</description>
      <pubDate>Thu, 26 Jun 2003 12:41:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008691#M911229</guid>
      <dc:creator>Kenneth_19</dc:creator>
      <dc:date>2003-06-26T12:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Question about script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008692#M911230</link>
      <description>If you're putting this pair of lines from each block into the same file, then&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;grep -e ^date: -e ^class: &amp;gt; /some/file&lt;BR /&gt;&lt;BR /&gt;should do the trick.</description>
      <pubDate>Thu, 26 Jun 2003 12:42:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008692#M911230</guid>
      <dc:creator>Bill Douglass</dc:creator>
      <dc:date>2003-06-26T12:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Question about script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008693#M911231</link>
      <description>Sorry, typo in my replyt:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;grep -e ^date: -e ^class: /path/to/file &amp;gt; /some/file&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Jun 2003 12:43:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008693#M911231</guid>
      <dc:creator>Bill Douglass</dc:creator>
      <dc:date>2003-06-26T12:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Question about script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008694#M911232</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;grep -e class -e date file &amp;gt; file.out&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;        Steve Steel</description>
      <pubDate>Thu, 26 Jun 2003 12:43:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008694#M911232</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2003-06-26T12:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Question about script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008695#M911233</link>
      <description>Hi!&lt;BR /&gt;&lt;BR /&gt;Use the grep command to do what you want. See from the man page:&lt;BR /&gt;&lt;BR /&gt;grep, egrep, fgrep - search a file for a pattern&lt;BR /&gt; &lt;BR /&gt; SYNOPSIS&lt;BR /&gt;    Plain call with pattern&lt;BR /&gt;      grep [-E|-F] [-c|-l|-q] [-bhinsvwx] pattern [file ...]&lt;BR /&gt; &lt;BR /&gt;    Call with (multiple) -e pattern&lt;BR /&gt;      grep [-E|-F] [-c|-l|-q] [-bhinsvwx] -e pattern...  [-e pattern] ...&lt;BR /&gt;           [file ...]&lt;BR /&gt; &lt;BR /&gt;Look at the line with the word multiple for details and re-direct to a new file like every other person mentioned (grep -e class -e date file &amp;gt; newfile) Check the man pages for more information. &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dario&lt;BR /&gt;</description>
      <pubDate>Thu, 26 Jun 2003 12:56:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008695#M911233</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2003-06-26T12:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Question about script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008696#M911234</link>
      <description>Thanks guys.&lt;BR /&gt;one final thing....&lt;BR /&gt;the resultant output is something like this..&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;class: 1234&lt;BR /&gt;date: 2003-6-26@08:01am&lt;BR /&gt;class: 0000&lt;BR /&gt;date: 2003-6-26@08:02am&lt;BR /&gt;class: 9999&lt;BR /&gt;date: 2003-6-26@08:03am&lt;BR /&gt;class: 0000&lt;BR /&gt;date: 2003-6-26@08:04am&lt;BR /&gt;class: 1234&lt;BR /&gt;date: 2003-6-26@08:05am&lt;BR /&gt;class: 0000&lt;BR /&gt;date: 2003-6-26@08:06am&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;From this file, I need to be able to list only the lines with class 0000 and their corresponding date</description>
      <pubDate>Thu, 26 Jun 2003 12:58:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008696#M911234</guid>
      <dc:creator>Anthony_69</dc:creator>
      <dc:date>2003-06-26T12:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Question about script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008697#M911235</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;awk '/class: 0000/{print ; getline ; print}' file&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Thu, 26 Jun 2003 13:02:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008697#M911235</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-06-26T13:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Question about script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008698#M911236</link>
      <description>Or ...&lt;BR /&gt;&lt;BR /&gt;sed -n '/class: 0000/ {&lt;BR /&gt;N&lt;BR /&gt;p&lt;BR /&gt;}' file&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Thu, 26 Jun 2003 13:05:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008698#M911236</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-06-26T13:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Question about script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008699#M911237</link>
      <description>Anthony,&lt;BR /&gt;&lt;BR /&gt;Assume that you have the output in a file named output.txt.  Below is a script to do what you want:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;while read CLASS&lt;BR /&gt;do&lt;BR /&gt;read DATE&lt;BR /&gt;if [ "$CLASS" = "class: 0000" ]&lt;BR /&gt;then&lt;BR /&gt;echo $CLASS&lt;BR /&gt;echo $DATE&lt;BR /&gt;fi&lt;BR /&gt;done &amp;lt; output.txt&lt;BR /&gt;&lt;BR /&gt;Hai</description>
      <pubDate>Thu, 26 Jun 2003 13:06:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008699#M911237</guid>
      <dc:creator>Hai Nguyen_1</dc:creator>
      <dc:date>2003-06-26T13:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Question about script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008700#M911238</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;With regard to your last question, using your file as presented:&lt;BR /&gt;&lt;BR /&gt;# awk '/^class: 0000/ {print $0;getline;print $0}' inputfile &amp;gt; outputfile&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 26 Jun 2003 13:08:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008700#M911238</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2003-06-26T13:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Question about script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008701#M911239</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;awk 'BEGIN{var=0}{if ($2=="0000"){print;var=NR+1} if (NR==var) print}' your.file &lt;BR /&gt;&lt;BR /&gt;have fun, ionut</description>
      <pubDate>Fri, 27 Jun 2003 09:15:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008701#M911239</guid>
      <dc:creator>Ionut Grigorescu_2</dc:creator>
      <dc:date>2003-06-27T09:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Question about script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008702#M911240</link>
      <description>Hello!&lt;BR /&gt;&lt;BR /&gt;Use with awk:&lt;BR /&gt;awk '/class: 0000/ {print $0; getline; print $0}' orig_file &amp;gt; new_file&lt;BR /&gt;&lt;BR /&gt;Caesar</description>
      <pubDate>Fri, 27 Jun 2003 16:19:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/question-about-script/m-p/3008702#M911240</guid>
      <dc:creator>Caesar_3</dc:creator>
      <dc:date>2003-06-27T16:19:27Z</dc:date>
    </item>
  </channel>
</rss>

