<?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: What script to use in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/what-script-to-use/m-p/2943677#M930672</link>
    <description>Hi Kenneth,&lt;BR /&gt;&lt;BR /&gt;awk '$2 ~ "^CCC" {print}' your_file&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
    <pubDate>Sat, 05 Apr 2003 00:31:07 GMT</pubDate>
    <dc:creator>Sridhar Bhaskarla</dc:creator>
    <dc:date>2003-04-05T00:31:07Z</dc:date>
    <item>
      <title>What script to use</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/what-script-to-use/m-p/2943672#M930667</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am working with a huge log file that is space/tab delimeted like below:&lt;BR /&gt;&lt;BR /&gt;AAABBB CCCDDD EEEFFF GGGHHH JJJKKK&lt;BR /&gt;LLLMMM NNNOOO PPPQQQ RCCCSS TTTUUU&lt;BR /&gt;ZCCCXX YYYHHH FFFLLL SDFAWE SWRDFG&lt;BR /&gt;QWEsdf CCCsdh asderi asdkef lksdoj&lt;BR /&gt;&lt;BR /&gt;What I want to accomplish is after the log file has gone to the script, the script would only display or list the line which contains a pattern in a specific column.&lt;BR /&gt;&lt;BR /&gt;So for the example above, I only want to list or display the lines which contains the "CCC" pattern on column 2. So the output file of the script would be:&lt;BR /&gt;&lt;BR /&gt;AAABBB CCCDDD EEEFFF GGGHHH JJJKKK&lt;BR /&gt;QWEsdf CCCsdh asderi asdkef lksdoj&lt;BR /&gt;&lt;BR /&gt;What I usually do is import this textfile into MS excel and sort it but MS excel can handle only upto 65K rows whereas the text file I'm using is up to a 100K rows or more.  Also, I wish to do this in a unix enviroment and not transfer from one system to another.&lt;BR /&gt;&lt;BR /&gt;Which editor can handle this better AWK or SED and could you give me a sample working script.&lt;BR /&gt;&lt;BR /&gt;Any help is appreciated as I'm totally not very familiar with SED or AWK or scripting in general.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;Kenneth</description>
      <pubDate>Fri, 04 Apr 2003 04:01:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/what-script-to-use/m-p/2943672#M930667</guid>
      <dc:creator>Kenneth_18</dc:creator>
      <dc:date>2003-04-04T04:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: What script to use</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/what-script-to-use/m-p/2943673#M930668</link>
      <description>see if this helps.&lt;BR /&gt;&lt;BR /&gt;+++++&lt;BR /&gt;cat a&lt;BR /&gt;AAABBB CCCDDD EEEFFF GGGHHH JJJKKK&lt;BR /&gt;LLLMMM NNNOOO PPPQQQ RCCCSS TTTUUU&lt;BR /&gt;ZCCCXX YYYHHH FFFLLL SDFAWE SWRDFG&lt;BR /&gt;QWEsdf CCCsdh asderi asdkef lksdoj&lt;BR /&gt;[balajin@ec2t5101743 tmp]$ awk ' $2 ~ /CCC/ {  print  }' a&lt;BR /&gt;AAABBB CCCDDD EEEFFF GGGHHH JJJKKK&lt;BR /&gt;QWEsdf CCCsdh asderi asdkef lksdoj&lt;BR /&gt;+++++++++++++++++++++++++&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$2 is the field you want to search for the and with in the slashes you put the characters you want to search for.&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;-balaji</description>
      <pubDate>Fri, 04 Apr 2003 04:21:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/what-script-to-use/m-p/2943673#M930668</guid>
      <dc:creator>Balaji N</dc:creator>
      <dc:date>2003-04-04T04:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: What script to use</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/what-script-to-use/m-p/2943674#M930669</link>
      <description>Hi Kenneth,&lt;BR /&gt;&lt;BR /&gt;This is exactly where you have logsurfer for.&lt;BR /&gt;&lt;BR /&gt;You have a log-file of a specific size.&lt;BR /&gt;You create a conf-file with search patterns and actions.&lt;BR /&gt;&lt;BR /&gt;So in your case lines of :&lt;BR /&gt;&lt;BR /&gt;'^([^ ]+) CCC*' - - - 0 pipe '/usr/local/bin/myprogram "Clines"'&lt;BR /&gt;'^([^ ]+) BBB([^ ]+) CCC*' - - - 0 pipe '/usr/local/bin/myprogram "BandClines"'&lt;BR /&gt;&lt;BR /&gt;The first rule will start with a column of unknown characters, than the secons column has only CCC and followed by more columns.&lt;BR /&gt;The secons rule will start with a column of unkown characters and followed by BBBsomethingelse and the third column CCCand some other characters and/or columns.&lt;BR /&gt;You create the script myprogram that reads the first param and adds it to your file. By using a program to call you can do lot's of manipulation, etc and you can re-use it every time.&lt;BR /&gt;&lt;BR /&gt;I'll add all the files for you of logsurfer, inclusive the ./logsurfer/etc/conf.syslog with lots of examples !&lt;BR /&gt;&lt;BR /&gt;Regs David</description>
      <pubDate>Fri, 04 Apr 2003 05:46:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/what-script-to-use/m-p/2943674#M930669</guid>
      <dc:creator>David_246</dc:creator>
      <dc:date>2003-04-04T05:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: What script to use</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/what-script-to-use/m-p/2943675#M930670</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;file=$1&lt;BR /&gt;typeset -i column=$2&lt;BR /&gt;search=$3&lt;BR /&gt;cat $file|while read line&lt;BR /&gt;  do&lt;BR /&gt;    set $(echo $line)&lt;BR /&gt;      if [ "$column" -gt "1" ]&lt;BR /&gt;      then&lt;BR /&gt;         typeset -i colum1=$column-1&lt;BR /&gt;         shift $colum1&lt;BR /&gt;      fi&lt;BR /&gt;    y=$1&lt;BR /&gt;    x=${y#$search}&lt;BR /&gt;      if [ "$x" != "$1" ]&lt;BR /&gt;      then&lt;BR /&gt;        echo $line&lt;BR /&gt;      fi&lt;BR /&gt;  done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Parameters are fiel column and pattern&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;              Steve Steel</description>
      <pubDate>Fri, 04 Apr 2003 07:24:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/what-script-to-use/m-p/2943675#M930670</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2003-04-04T07:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: What script to use</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/what-script-to-use/m-p/2943676#M930671</link>
      <description>cat &lt;YOUR logfile=""&gt; |awk '$2 ~/^CCC/ {print}'&lt;BR /&gt;&lt;/YOUR&gt;</description>
      <pubDate>Sat, 05 Apr 2003 00:17:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/what-script-to-use/m-p/2943676#M930671</guid>
      <dc:creator>Wilfred Chau_1</dc:creator>
      <dc:date>2003-04-05T00:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: What script to use</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/what-script-to-use/m-p/2943677#M930672</link>
      <description>Hi Kenneth,&lt;BR /&gt;&lt;BR /&gt;awk '$2 ~ "^CCC" {print}' your_file&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Sat, 05 Apr 2003 00:31:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/what-script-to-use/m-p/2943677#M930672</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2003-04-05T00:31:07Z</dc:date>
    </item>
  </channel>
</rss>

