<?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 Output formatting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081124#M811085</link>
    <description>File attached with detail requirement.&lt;BR /&gt;Please help. Very urgent.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
    <pubDate>Mon, 29 Sep 2003 16:50:36 GMT</pubDate>
    <dc:creator>Raj_38</dc:creator>
    <dc:date>2003-09-29T16:50:36Z</dc:date>
    <item>
      <title>Output formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081124#M811085</link>
      <description>File attached with detail requirement.&lt;BR /&gt;Please help. Very urgent.&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Mon, 29 Sep 2003 16:50:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081124#M811085</guid>
      <dc:creator>Raj_38</dc:creator>
      <dc:date>2003-09-29T16:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Output formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081125#M811086</link>
      <description>1SUM=0&lt;BR /&gt;2SUM=0&lt;BR /&gt;3SUM=0&lt;BR /&gt; &lt;BR /&gt;cat FILE | while read DEPT DATE CUST RES&lt;BR /&gt;do&lt;BR /&gt; &lt;BR /&gt; case $DEPT in&lt;BR /&gt;  DEPT1) 1SUM=$(($1SUM+1));;&lt;BR /&gt;  DEPT2) 2SUM=$(($2SUM+1));;&lt;BR /&gt;  DEPT3) 3SUM=$(($3SUM+1));;&lt;BR /&gt; esac&lt;BR /&gt; &lt;BR /&gt;done</description>
      <pubDate>Mon, 29 Sep 2003 18:18:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081125#M811086</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2003-09-29T18:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Output formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081126#M811087</link>
      <description>Raj&lt;BR /&gt;I'd like to help, this should be trivial since you have only 1 table, but you don't give enough information.&lt;BR /&gt;What is a "recent 2 contact", likewise 5 and 3 ??&lt;BR /&gt;&lt;BR /&gt;-- Graham</description>
      <pubDate>Tue, 30 Sep 2003 02:23:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081126#M811087</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2003-09-30T02:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Output formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081127#M811088</link>
      <description>Hi Rai,&lt;BR /&gt; &lt;BR /&gt;if the "recent contacts" are those in your original input file, then try running the attached script with your input file as $1.&lt;BR /&gt;If not, please explain "recent".&lt;BR /&gt; &lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Tue, 30 Sep 2003 07:34:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081127#M811088</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-09-30T07:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Output formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081128#M811089</link>
      <description>I'm surprised to see all have opted for shell script rather than oracle procedure...&lt;BR /&gt;anyway.....let me explain more clearly....&lt;BR /&gt;&lt;BR /&gt;Yes i have all details in one single database table.&lt;BR /&gt;&lt;BR /&gt;Attached document with more details...hope i'm making myself clear....&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;  &lt;BR /&gt;</description>
      <pubDate>Tue, 30 Sep 2003 10:45:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081128#M811089</guid>
      <dc:creator>Raj_38</dc:creator>
      <dc:date>2003-09-30T10:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: Output formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081129#M811090</link>
      <description>Is the reqmnt not clear ? Urgent pls.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Raj</description>
      <pubDate>Tue, 30 Sep 2003 12:06:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081129#M811090</guid>
      <dc:creator>Raj_38</dc:creator>
      <dc:date>2003-09-30T12:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Output formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081130#M811091</link>
      <description>If we assume your departments are named "DEPT1","DEPT2", and "DEPT3" and that the dates are zero filled 2 digit, then the following perl script may do the trick-&lt;BR /&gt;  &lt;BR /&gt;%numhold=("DEPT1",1,"DEPT2",4,"DEPT3",2);&lt;BR /&gt;while(&lt;INP&gt;) {&lt;BR /&gt; chomp;&lt;BR /&gt; ($dept,$date,$cust,$rslt)=split('\s+',$_);&lt;BR /&gt; ($m,$d,$y)=split("/",$date); $y+=$y &amp;lt; 10 ? 2000 : 1900;&lt;BR /&gt; $ymd="$y/$m/$d";&lt;BR /&gt; $datum=$hold{$cust}{$dept};&lt;BR /&gt; $datum=[] unless $datum;&lt;BR /&gt; push(@{$datum},$ymd . "+" . $rslt);&lt;BR /&gt; @{$datum}=(reverse sort @{$datum})[0..$numhold{$dept}];&lt;BR /&gt; $hold{$cust}{$dept}=$datum;&lt;BR /&gt;}&lt;BR /&gt;foreach $cust (sort keys %hold) {&lt;BR /&gt; print $cust;&lt;BR /&gt; foreach $dept ("DEPT1","DEPT2","DEPT3") {&lt;BR /&gt;  print "+$dept";&lt;BR /&gt;  foreach $datex (1..$numhold{$dept}) {&lt;BR /&gt;   print "+$hold{$cust}{$dept}[$datex]";&lt;BR /&gt;  }&lt;BR /&gt; }&lt;BR /&gt; print "\n";&lt;BR /&gt;}&lt;BR /&gt;   &lt;BR /&gt;The date format will be re-arranged to Y/M/D format (easier for sorts).&lt;BR /&gt;  &lt;BR /&gt;To run-&lt;BR /&gt;perl thisscript &lt;YOURTABLE&gt;newformat&lt;BR /&gt;  &lt;BR /&gt;This script also has the benefits if a customer lets say only has 1 contact to DEPT1, then the second contact data will be still have a place holder.&lt;BR /&gt;  &lt;BR /&gt;HTH&lt;BR /&gt;  &lt;BR /&gt;-- Rod Hills&lt;/YOURTABLE&gt;&lt;/INP&gt;</description>
      <pubDate>Tue, 30 Sep 2003 12:38:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081130#M811091</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-09-30T12:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Output formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081131#M811092</link>
      <description>PS-&lt;BR /&gt;&lt;BR /&gt;If the data you are processing is in an Oracle DB (or any other DB), then perl can access the DB directly without the need of an export file.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 30 Sep 2003 12:46:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081131#M811092</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-09-30T12:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Output formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081132#M811093</link>
      <description>My data is available in Oracle database.&lt;BR /&gt;I can either use Oracle procedure for this or unix shell script. I cannot use pearl script or others.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Raj</description>
      <pubDate>Tue, 30 Sep 2003 13:28:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081132#M811093</guid>
      <dc:creator>Raj_38</dc:creator>
      <dc:date>2003-09-30T13:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Output formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081133#M811094</link>
      <description>If you are running hp-ux (which I assume that's why you posted to this forum), then "perl" is available on your system.&lt;BR /&gt;&lt;BR /&gt;The script above is assuming a flat text file to process.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 30 Sep 2003 13:30:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081133#M811094</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-09-30T13:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Output formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081134#M811095</link>
      <description>Well, it's a pretty odd request, and your example output doesn't match the stipulated format, but I think the attached will do what you're after. Save it as a .sql file and run from sqlplus.&lt;BR /&gt;You'll have to tweak the table and col names, (shown in upper case) as I don't know your exact ones.&lt;BR /&gt;&lt;BR /&gt;-- Graham</description>
      <pubDate>Wed, 01 Oct 2003 05:01:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/output-formatting/m-p/3081134#M811095</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2003-10-01T05:01:48Z</dc:date>
    </item>
  </channel>
</rss>

