Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Create bins with totals and percentage Post 303044102 by vgersh99 on Thursday 13th of February 2020 05:22:21 PM
Old 02-13-2020
RudiC/rdrtx1,
the binning, the percentage and the totals are somewhat different from the OP's desired output in post #1.
Hence post #2 with the ask to elaborate.
These 2 Users Gave Thanks to vgersh99 For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calculating totals in AWK

Hello, With the following small script I list the size of documents belonging to a certain user by each time selecting the bytes-field of that file ($7). Now it fills the array with every file it finds so in the end the output of some users contains up to 200.000 numbers. So how can I calculate... (7 Replies)
Discussion started by: Hille
7 Replies

2. Shell Programming and Scripting

summarising totals in awk

awk ' FILENAME == "all" { balance += substr($0,17,13) dt = substr($0,6,8) } END { for ( name in balance ) printf("%013s %3s of %8s\n", balance/100,name,dt) | "sort " } ' all > summation using this code i wanted to take summary totals of... (3 Replies)
Discussion started by: paresh n doshi
3 Replies

3. Shell Programming and Scripting

Report Totals

Hello, I have written a script in a previous server and its being migrated to a new server. I'm trying to debug my script since i've had to make minor changes to it to get it to work. I'm having a hard time getting my totals to populate here is the syntax DUMP_COUNT=`sqlplus -S... (4 Replies)
Discussion started by: senormarquez
4 Replies

4. Shell Programming and Scripting

Totals in a file - incorrectly displaying

Afternoon, I have a script which creates/modifies data into a formatted csv. The trailer record should display 2 columns, the first is a static entry of "T" to identify it as a trailer record. The 2nd is a total of amounts in a column throughout the entire file. My total isn't displaying... (8 Replies)
Discussion started by: mcclunyboy
8 Replies

5. Shell Programming and Scripting

Calculating frequency of values within bins

Hi, I am working with files containing 2 columns in which i need to come up with the frequency/count of values in col. 2 falling within specifics binned values of col. 1. the contents of a sample file is shown below: 15 12.5 15 11.2 16 0.2 16 1.4 17 1.6 18 4.5 17 5.6 12 8.6 11 7.2 9 ... (13 Replies)
Discussion started by: ida1215
13 Replies

6. Solaris

Redirecting print to optional output bins

Guys We have a HP P4015 laserjet printer with a 5 bin mailbox attached & configured. We can print to the specific output bins from Oracle e-Business suite, however our print output format is incompatible so it prints out random characters instead of the letter content. I have looked... (2 Replies)
Discussion started by: s1977
2 Replies

7. UNIX for Dummies Questions & Answers

awk solution for taking bins

Hi all, I'm looking for an awk solution for taking bins of data set. For example, if I have two columns of data that I wish to use for a scatter plot, and it contains 5 million lines, how can I take averages of every 100 points, 1000, 10000 etc... The idea is to take bins of the 5,000,000 points... (7 Replies)
Discussion started by: torchij
7 Replies

8. Shell Programming and Scripting

Grand totals in awk

I have a one-liner script like this that gives a total of everything in various directories: for i in *; do (cd $i && cd statelist && echo $i && ls -la |awk 'NR>3 {SUM += $5}\ END { print "Total number of elements " SUM }');done It works just great but at the end I want to print a grand... (3 Replies)
Discussion started by: newbie2010
3 Replies

9. Shell Programming and Scripting

awk to select 2D data bins

I wish to use AWK to do something akin: Select all 2D data with 1<$1<2 and -7.5<$2<-6.5 But it's not working awk 'END {print ($1<=2&&$1>=1&&$2<=-6.5&&$2>=-7.5)}' bla Data: -1.06897 -8.04482 -61.469 -1.13613 -8.04482 -61.2271 -1.00182 -8.04482 -61.2081 -1.06897 -8.13518 -60.8544... (2 Replies)
Discussion started by: chrisjorg
2 Replies
IKC(3pm)						User Contributed Perl Documentation						  IKC(3pm)

NAME
POE::Component::IKC -- POE Inter-Kernel Communication SYNOPSIS
IKC server use POE::Component::IKC::Server; # create all your sessions POE::Component::IKC::Server->spawn( port=>30, name=>'Server' ); # more options are available $poe_kernel->run(); IKC client use POE::Component::IKC::Client; POE::Component::IKC::Client->spawn( host=>name, port=>30, name=>'Client', on_connect=>&build); $poe_kernel->run(); sub build { # create sessions that depend on the foreign kernel. } Post a state on a foreign kernel $kernel->post('IKC', 'post', "poe://Server/session/state", $ONE_arg); The IKC is peer-to-peer. Server can post to client. $kernel->post('IKC', 'post', 'poe://Client/session/state', $ONE_arg); Call a state on a remote kernel Call semantics are impossible, because they would cause POE to block. IKC call is a bit different. It is a 'post', but with an extra RSVP parameter. $kernel->post('IKC', 'call', 'poe://Server/hello/world', $ONE_arg, 'poe:callback'); This will cause the returned value of the foreign state to be sent to state 'callback' in the current session. You may want the callback to be in another session, but I don't think this is a good idea. $kernel->post('IKC', 'call', 'poe://Server/hello/world', $ONE_arg, 'poe:/elsewhere/hi'); Note : if you use ->call('IKC'), it will return the number of foreign kernels the state was sent to. This is a handy way to find out if you are still connected to a foreign kernel. A little magic If a state is posted by a foreign kernel, $_[SENDER] is only valid during that state. However, you will be able to post back to it. $kernel->post($_[SENDER], 'something', 'the answer is foo'); The remote caller MUST have published states for them to be callable, eh? Publish / Subscribe You must publish a session's interface for it to be available to remote kernels. If you subscribe to a remote session, you may access it as if it was a local session. First, a session publishes its interfaces: $kernel->post('IKC', 'publish', 'session_alias', [qw(state1 state2 state3 state4)], ); Then a foreign kernel subscribes to it: # Look for a session on all known foreign kernels $kernel->post('IKC', 'subscribe', [qw(poe://*/session_alias/)]); # Look for a session on a specific foreign kernel $kernel->post('IKC', 'subscribe', [qw(poe://Pulse/timeserver)]); # Make sure the session has a given state $kernel->post('IKC', 'subscribe', [qw(poe://*/timeserver/connect)]); After subscription, a proxy session is created that can be accessed like any old session, though ->call() acts the same as ->post() for obvious reasons: $kernel->post('poe:/Pulse/timeserver', 'state', $arg1, $arg2...); Currently, the session alias used by post to the proxy session must be the same one as used when subscribing. Because kernels have multiple names, if you are using '*' as the kernel name when subscribing, the session alias might not be what you think it is. See "Monitor" for details. Of course, attempting to post to a proxy session before it is created will be problematic. To be alerted when the proxy session is created, a callback state may be specified, $kernel->post('IKC', 'subscribe', [qw(poe://*/timeserver)], 'timeserver_subscribed'); The callback will be called with a list of all the sessions that it managed to subscribe to. You should check this list before continuing. Better yet, you could use the IKC monitor (see below). One can also let POE::Component::IKC::Client->spawn deal with all the details. POE::Component::IKC::Client->spawn( port=>31337, name=>$name, subscribe=>[qw(poe://*/timeserver)], on_connect=>&create_me, ); 'on_connect' is only called when all the subscriptions have either been accepted. If a subscription was refused, create_ikc_client will give up. If multiple foreign kernels where quieried for a session (as is the case above), subscription is deemed to succeed if at least one foreign kernel accepts the subscription. To undo things : $kernel->post(IKC=>'retract', 'session_alias'=>[qw(states)]); $kernel->post(IKC=>'unsubscribe', [qw(poe://Pulse/timeserver)]); Monitor Say you wanted to monitor all remote kernels that connect to you: $kernel->post(IKC=>'monitor', '*'=>{register=>'some_event'}); sub some_event { my($name, $real)=@_[ARG1, ARG2]; print "- Remote kernel ", ($real ? '' : "alias "), "$name connected "; } Later, you want to know when a given remote session disconnects: $kernel->post(IKC=>'monitor', some_kernel=>{unregister=>'bye_bye'}); Or maybe you think a session should clean up and leave whenever IKC does. $kernel->post(IKC=>'monitor', '*'=>{shutdown=>'other_event'}); sub other_event { # kill wheels, alarms, selects and aliases here } See "monitor" in POE::Component::IKC::Responder for more details. Shutdown When you feel the time is right and you want to get rid of all IKC-related sessions, just do the following: $kernel->post(IKC=>'shutdown'); And they should all disapear. At worst, some will still have registered alises, but this won't prevent the kernel from exiting. The local kernel You can post to the local kernel as if it was remote: $kernel->post(IKC=>'post', "poe://$kernel->ID/session/state'=>$ONE_arg); However, you can't currently subscribe to local sessions. I don't know how I'm going to resolve this. DESCRIPTION
This is Inter-Kernel Communication for POE. It is used to get events from one POE kernel to another SEE ALSO
POE::Component::IKC::Responder -- Heart of the system POE::Component::IKC::Server -- Create a process that listens for other kernels. POE::Component::IKC::Client -- Create a process that connects to other kernels. POE::Component::IKC::ClientLite -- Light weight IKC implementation for places you can't use POE, such as mod_perl. POE::Component::IKC::Channel -- Handle communcation with other kernels. POE::Component::IKC::Proxy -- Proxy session that is created when you subscribe to a remote session. POE::Component::IKC::Freezer -- Pure-Perl serialization method. POE::Component::IKC::Specifier -- Helper routines for parsing IKC specifiers. AUTHOR
Philip Gwyn <perl-ikc at pied.nu> COPYRIGHT AND LICENSE
Copyright 1999-2011 by Philip Gwyn. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/language/misc/Artistic.html> perl v5.12.4 2011-08-27 IKC(3pm)
All times are GMT -4. The time now is 01:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy