<?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: Sorting Data in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343283#M683829</link>
    <description>Thanks Hein for the help Hein!!&lt;BR /&gt;&lt;BR /&gt;1) a plain TEXT sample for 3 or 4 corresponding seconds for input and desired output. - attached&lt;BR /&gt; &lt;BR /&gt;2) what to do when a timestamp is missing in either file, or when a column value is missing in the remote file. - no need to deal with this condition&lt;BR /&gt;&lt;BR /&gt;3) Don't you need an avg, min, max, and time for those as you are processing the data anyway? - not really needed but if its relatively simple then yes.</description>
    <pubDate>Fri, 23 Jan 2009 07:06:42 GMT</pubDate>
    <dc:creator>Allanm</dc:creator>
    <dc:date>2009-01-23T07:06:42Z</dc:date>
    <item>
      <title>Sorting Data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343278#M683824</link>
      <description>&lt;BR /&gt;I have some stats from the wget command I ran last night to troubleshoot a network latency issue. I am attaching the results in an excel sheet.&lt;BR /&gt;&lt;BR /&gt;There are 3 sheets , the two sheets have results and the last sheet has a sample of results the way I want it to present. Is there a way to format the data the way I want it to be presented.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
      <pubDate>Fri, 23 Jan 2009 00:51:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343278#M683824</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-01-23T00:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343279#M683825</link>
      <description>fyi... I can not 'see' the zip attachment. It does not download. &lt;BR /&gt;&lt;BR /&gt;Irrespective of that, this question is posted in an HPUX forum which natively does not grow excel speadsheets.&lt;BR /&gt;&lt;BR /&gt;The original layout of the the data may well influence the right choice of tools to help you solve the problem. &lt;BR /&gt;&lt;BR /&gt;How is the data originally delivered? &lt;BR /&gt;How would the output idealy be presented?&lt;BR /&gt;Fixed width columns, Comma-Seperated-Values, XML, ...&lt;BR /&gt;&lt;BR /&gt;Please retry a reply with the zip file, or better still a (single) .TXT file showing a good chunk of the original input and desired output?&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Jan 2009 01:29:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343279#M683825</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-01-23T01:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343280#M683826</link>
      <description>Here is the script that I am using:&lt;BR /&gt;&lt;BR /&gt;There are two script, here is the one which I use from a remote server:&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;export http_proxy="http://proxy"&lt;BR /&gt;export https_proxy="http://proxy"&lt;BR /&gt;exec &amp;gt; /tmp/wget_output.txt 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;while true; do&lt;BR /&gt;   echo -n "&amp;gt; " &amp;amp;&amp;amp; date&lt;BR /&gt;echo -n "web1   ";/usr/bin/time wget -q --no-check-certificate -O /dev/null &lt;A href="https://web1.com/testweb.html" target="_blank"&gt;https://web1.com/testweb.html&lt;/A&gt; 2&amp;gt;&amp;amp;1 |grep user|awk '{print $3}'&lt;BR /&gt;echo -n "web2   ";/usr/bin/time wget -q --no-check-certificate -O /dev/null &lt;A href="https://web2.com/testweb.html" target="_blank"&gt;https://web2.com/testweb.html&lt;/A&gt; 2&amp;gt;&amp;amp;1 |grep user|awk '{print $3}'&lt;BR /&gt;echo -n "web3   ";/usr/bin/time wget -q --no-check-certificate -O /dev/null &lt;A href="https://web3.com/testweb.html" target="_blank"&gt;https://web3.com/testweb.html&lt;/A&gt; 2&amp;gt;&amp;amp;1 |grep user|awk '{print $3}'&lt;BR /&gt;echo -n "web4   ";/usr/bin/time wget -q --no-check-certificate -O /dev/null &lt;A href="https://web4.com/testweb.html" target="_blank"&gt;https://web4.com/testweb.html&lt;/A&gt; 2&amp;gt;&amp;amp;1 |grep user|awk '{print $3}'&lt;BR /&gt;echo -n "web5   ";/usr/bin/time wget -q --no-check-certificate -O /dev/null &lt;A href="https://web5.com/testweb.html" target="_blank"&gt;https://web5.com/testweb.html&lt;/A&gt; 2&amp;gt;&amp;amp;1 |grep user|awk '{print $3}'&lt;BR /&gt;echo -n "web6   ";/usr/bin/time wget -q --no-check-certificate -O /dev/null &lt;A href="https://web6.com/testweb.html" target="_blank"&gt;https://web6.com/testweb.html&lt;/A&gt; 2&amp;gt;&amp;amp;1 |grep user|awk '{print $3}'&lt;BR /&gt;echo -n "web7   ";/usr/bin/time wget -q --no-check-certificate -O /dev/null &lt;A href="https://web7.com/testweb.html" target="_blank"&gt;https://web7.com/testweb.html&lt;/A&gt; 2&amp;gt;&amp;amp;1 |grep user|awk '{print $3}'&lt;BR /&gt;   sleep 1&lt;BR /&gt;done | sed 's/elapsed//'&lt;BR /&gt;&lt;BR /&gt;Here is the one which I used locally on the web server:&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;exec &amp;gt; /tmp/wget_output.txt 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;while true; do&lt;BR /&gt;   echo -n "&amp;gt; " &amp;amp;&amp;amp; date&lt;BR /&gt;echo -n "web1   ";/usr/bin/time wget -q --no-check-certificate -O /dev/null &lt;A href="https://web1.com/testweb.html" target="_blank"&gt;https://web1.com/testweb.html&lt;/A&gt; 2&amp;gt;&amp;amp;1 |grep user|awk '{print $3}'&lt;BR /&gt;   sleep 1&lt;BR /&gt;done | sed 's/elapsed//'&lt;BR /&gt;&lt;BR /&gt;Through the two scripts I compare as to what the issue is, through script one I am trying to look for network latency and through script two I am trying to look for apache issues.&lt;BR /&gt;&lt;BR /&gt;I am attaching a word file with the screen shots of the excel sheet that I attached earlier, so you can derive as to which way I want the data to be presented and then I can work on getting a graph from that data.&lt;BR /&gt;&lt;BR /&gt;I am not good at perl but I am wondering if there can a perl script which can make my life easier.</description>
      <pubDate>Fri, 23 Jan 2009 01:55:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343280#M683826</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-01-23T01:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343281#M683827</link>
      <description>And just FYI I was able to open the attachments through IE and not through Firefox.</description>
      <pubDate>Fri, 23 Jan 2009 01:58:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343281#M683827</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-01-23T01:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343282#M683828</link>
      <description>&amp;gt;&amp;gt; And just FYI I was able to open the attachments through IE and not through Firefox.&lt;BR /&gt;&lt;BR /&gt;And I could not read get to the ZP file with IE 6.0, but it worked with chrome.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;... testweb.html  2&amp;gt;&amp;amp;1 |grep user|awk '{print $3}'&lt;BR /&gt;&lt;BR /&gt;First a side comment to get that out of my system: &lt;BR /&gt;Why pipe from grep to awk?&lt;BR /&gt;awk will be happy to do the filter:&lt;BR /&gt;.. testweb.html 2&amp;gt;&amp;amp;1 |awk '/user/{print $3}'&lt;BR /&gt;&lt;BR /&gt;More importantly... don't print it just yet.&lt;BR /&gt;Stick it in a variable and glue that with a comma (or tab) to a variable for a line being build.&lt;BR /&gt;At the end of the while loop, print the whole line with seperators and all!&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; I am attaching a word file with the screen shots &lt;BR /&gt;&lt;BR /&gt;An other side command to get it out of my system. Why hide a PICTURE of a spreadsheet in a non-HPUX WORD format file when the DATA for the spreadsheet is just plain old text? Worse than Useless! &lt;BR /&gt;If it is text, present it as text pretty please! Leave Microsoft out of it!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; two sheets have results and the last sheet has a sample of results the way I want it to present&lt;BR /&gt;&lt;BR /&gt;Unfortunately the example output failed to use real data.&lt;BR /&gt;So it is not clear whether the column for 'web1' should come from the first dataset, or the second or should just be 0:00.14 !&lt;BR /&gt;&lt;BR /&gt;But enough nit-picking already!&lt;BR /&gt;&lt;BR /&gt;Here is a starting point.&lt;BR /&gt;This is a PERL script to read the second file and produce an excel-ready CSV file like:&lt;BR /&gt;&lt;BR /&gt;#perl test.pl test.txt&lt;BR /&gt;Date,web1,web2,web3,web4,web5,web6,web7&lt;BR /&gt;Tue Jan 20 16:17:49 PST 2009,0:00.14,0:00.07,0:00.08,0:00.08,0:00.09,0:00.06,0:00.07&lt;BR /&gt;Tue Jan 20 16:17:51 PST 2009,0:00.07,0:00.07,0:00.09,0:00.11,0:00.07,0:00.06,0:00.07&lt;BR /&gt;&lt;BR /&gt;-------------------- test.pl ---------&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my (@values, @names);&lt;BR /&gt;my $header = -1;&lt;BR /&gt;&lt;BR /&gt;push @names, 'Date'; # provide first column name&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;   chomp;&lt;BR /&gt;   if ( /\s\d\d\d\d$/ ) { # date line has 4 digits at end.&lt;BR /&gt;       print join (',',@names), "\n" unless $header++;&lt;BR /&gt;       print join (',',@values), "\n";&lt;BR /&gt;       @values = ($_);  # array becomes just the date line.&lt;BR /&gt;   }&lt;BR /&gt;   if ( /^(\S+)\s+(\d+:\d\d\.\d\d)/ ) {&lt;BR /&gt;       push @names, $1 unless $header;&lt;BR /&gt;       push @values, $2;  # add values to array&lt;BR /&gt;   }&lt;BR /&gt;}&lt;BR /&gt;print join (',',@values), "\n";  # last line.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now if you wanted to COMBINE the data from the two files, then you may want to run the above twice and use the 'join' command, or a csv tool to combine the results.&lt;BR /&gt;&lt;BR /&gt;Or you can augment the script to read two streams and keep them in sync, skipping ahead one or the other to catch up if need be... but that's like 'work'.&lt;BR /&gt;&lt;BR /&gt;If you promiss to just deal with a day at a time or so (86400 sample?) then you could easily use two perl associative array, keyed by time&amp;amp;date to combine the data.&lt;BR /&gt;Just fill the arrays and print at the end, The 'remote' array can just have whole lines or read up on 'Arrays of Arrays'.&lt;BR /&gt;&lt;BR /&gt;Before having some nice reader here dive into that, please provide more clear details.&lt;BR /&gt;&lt;BR /&gt;1) a plain TEXT sample for 3 or 4 corresponding seconds for input and desired output.&lt;BR /&gt;&lt;BR /&gt;2) what to do when a timestamp is missing in either file, or when a column value is missing in the remote file.&lt;BR /&gt;&lt;BR /&gt;3) Don't you need an avg, min, max, and time for those as you are processing the data anyway?&lt;BR /&gt;&lt;BR /&gt;Enjoy!&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Jan 2009 05:29:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343282#M683828</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-01-23T05:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343283#M683829</link>
      <description>Thanks Hein for the help Hein!!&lt;BR /&gt;&lt;BR /&gt;1) a plain TEXT sample for 3 or 4 corresponding seconds for input and desired output. - attached&lt;BR /&gt; &lt;BR /&gt;2) what to do when a timestamp is missing in either file, or when a column value is missing in the remote file. - no need to deal with this condition&lt;BR /&gt;&lt;BR /&gt;3) Don't you need an avg, min, max, and time for those as you are processing the data anyway? - not really needed but if its relatively simple then yes.</description>
      <pubDate>Fri, 23 Jan 2009 07:06:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343283#M683829</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-01-23T07:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343284#M683830</link>
      <description>&lt;!--!*#--&gt;Well, from the txt file it looks like you do NOT need to combine the two datasets. &lt;BR /&gt;If that's the case, then perl script I first publishes already solved the problem.&lt;BR /&gt;You can let it loose on both inputs.&lt;BR /&gt;&lt;BR /&gt;Here is is again with a TAB as seperator, and collecting MAX values as you go, and with indent spaces in the reply.&lt;BR /&gt;&lt;BR /&gt;( Any more bells and wissles is work... send money first! ;-)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Use as: # perl test.pl test.txt &amp;gt; test.tsv&lt;BR /&gt;&lt;BR /&gt;------------------- test.pl -------------&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my $seperator = "\t";&lt;BR /&gt;my ($i, @values, @names, @max);&lt;BR /&gt;my $header = -1;&lt;BR /&gt;&lt;BR /&gt;push @names, 'Date'; # provide first column name&lt;BR /&gt;&lt;BR /&gt;push @max, 'Maximums:';&lt;BR /&gt;while (&amp;lt;&amp;gt;) {&lt;BR /&gt;   chomp;&lt;BR /&gt;   if ( /\s\d\d\d\d$/ ) { # date line has 4 digits at end.&lt;BR /&gt;&lt;BR /&gt;       print join ($seperator,@names), "\n" unless $header++;&lt;BR /&gt;       print join ($seperator,@values), "\n";&lt;BR /&gt;       @values = ($_); # array becomes just the date line.&lt;BR /&gt;&lt;BR /&gt;       $i = 0;&lt;BR /&gt;   }&lt;BR /&gt;   if ( /^(\S+)\s+(\d+:\d\d\.\d\d)/ ) {&lt;BR /&gt;       if ( $header ) {&lt;BR /&gt;           $i++;&lt;BR /&gt;           $max[$i] = $2 if $2 gt $max[$i];&lt;BR /&gt;       } else {&lt;BR /&gt;           push @max, $2;&lt;BR /&gt;           push @names, $1;&lt;BR /&gt;       }&lt;BR /&gt;       push @values, $2;&lt;BR /&gt;   }&lt;BR /&gt;}&lt;BR /&gt;print join ($seperator,@values), "\n";&lt;BR /&gt;print join ($seperator,@max), "\n";&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Jan 2009 12:46:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343284#M683830</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-01-23T12:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting Data</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343285#M683831</link>
      <description>Works great !!!&lt;BR /&gt;&lt;BR /&gt;Thanks so much Hein, I have assigned 10 points each for your posts.&lt;BR /&gt;&lt;BR /&gt;Allan&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Jan 2009 22:43:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sorting-data/m-p/4343285#M683831</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2009-01-23T22:43:04Z</dc:date>
    </item>
  </channel>
</rss>

