Sponsored Content
Top Forums Shell Programming and Scripting awk and sum with original data Post 303025163 by vgersh99 on Thursday 25th of October 2018 12:05:45 PM
Old 10-25-2018
what's the key for each group/block?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read the data from multiple files and sum the value

Hi all, I have a requirement where i have to read multiple files using Shell Script in Korn Shell. each file will have the 3rd line as the amount field, i have to read this amount field and sum it for all the files. any idea on how to achieve this?? (i think i can achieve it using a loop,... (9 Replies)
Discussion started by: nvuradi
9 Replies

2. Shell Programming and Scripting

Identify matching data in a file and output to original line, in perl

Hi, I haven't done this for awhile, and further, I've never done it in perl so I appreciate any help you can give me. I have a file of lines, each with 5 data points that look like this: AB,N,ALLIANCEBERNSTEIN HLDNG L.P,AB,N ALD,N,ALLIED CAPITAL CORPORATION,ALD,N AFC,N,ALLIED CAPITAL... (4 Replies)
Discussion started by: Pcushing
4 Replies

3. UNIX for Advanced & Expert Users

A variable and sum of its value in a huge data.

Hi Experts, I got a question.. In the following output of `ps -elf | grep DataFlow` I get:- 242001 A mqsiadm 2076676 1691742 0 60 20 26ad4f400 130164 * May 09 - 3:02 DataFlowEngine EAIDVBR1_BROKER 5e453de8-2001-0000-0080-fd142b9ce8cb VIPS_INQ1 0 242001 A mqsiadm... (5 Replies)
Discussion started by: varungupta
5 Replies

4. UNIX for Dummies Questions & Answers

Sum of data in row format

Hi All, I have some numbers in two different files file1 4.21927E+00 4.68257E+00 5.56871E+00 3.59490E+01 7.65806E+01 1.39827E+02 and file2 5.61142E+00 6.21648E+00 7.40152E+00 4.41917E+01 8.31586E+01 1.42938E+02 I would like to get file3 which contains in each column the sum of the... (6 Replies)
Discussion started by: f_o_555
6 Replies

5. Shell Programming and Scripting

Help with calculate total sum of same data problem

Long list of input file: AGDRE1 0.1005449050 AGDRE1 2.1005443435 AGDRE1 1.2005449050 AGDRE1 5.1005487870 AASFV3 50.456304789 AASFV3 2.3659706549 AASFV3 6.3489807860 AASFV3 3.0089890148 RTRTRS 5.6546403546 . . Desired output file: AGDRE1 8.5021829410 AASFV3 62.180245240... (2 Replies)
Discussion started by: perl_beginner
2 Replies

6. Shell Programming and Scripting

AWK print and retain original format

I have a file with very specific column spacing formatting, I wish to do the following: awk '{print $1, $2, $3, $4, $5, $6, $19-$7, $20-$8, $21-$9, $10, $11, $12}' merge.pdb > vector.pdb but the format gets ruined. I have tried with print -f but to no avail.... (7 Replies)
Discussion started by: chrisjorg
7 Replies

7. Shell Programming and Scripting

Help with sum of data set

Input file 2 1159,310, 4 142,199,218,91, 3 91,273,349, Desired output result 2 1469 4 650 3 713 I have long list of input file as shown above. It has a "," delimited to separate between each record in column 2.... (1 Reply)
Discussion started by: perl_beginner
1 Replies

8. Shell Programming and Scripting

Help with sum range of data set together

Input File: 2000 3 1998 2 1997 2 1994 1 1991 1 1989 1 1987 2 1986 2 1985 1 1984 1 . . 10 277256 9 278274 8 282507 7 284837 6 287066 5 292967 (4 Replies)
Discussion started by: perl_beginner
4 Replies

9. UNIX for Advanced & Expert Users

Need Optimization shell/awk script to aggreagte (sum) for all the columns of Huge data file

Optimization shell/awk script to aggregate (sum) for all the columns of Huge data file File delimiter "|" Need to have Sum of all columns, with column number : aggregation (summation) for each column File not having the header Like below - Column 1 "Total Column 2 : "Total ... ...... (2 Replies)
Discussion started by: kartikirans
2 Replies
dispatch_group_create(3)				   BSD Library Functions Manual 				  dispatch_group_create(3)

NAME
dispatch_group_create, dispatch_group_async, dispatch_group_wait, dispatch_group_notify -- group blocks submitted to queues SYNOPSIS
#include <dispatch/dispatch.h> dispatch_group_t dispatch_group_create(void); void dispatch_group_enter(dispatch_group_t group); void dispatch_group_leave(dispatch_group_t group); long dispatch_group_wait(dispatch_group_t group, dispatch_time_t timeout); void dispatch_group_notify(dispatch_group_t group, dispatch_queue_t queue, void (^block)(void)); void dispatch_group_notify_f(dispatch_group_t group, dispatch_queue_t queue, void *context, void (*function)(void *)); void dispatch_group_async(dispatch_group_t group, dispatch_queue_t queue, void (^block)(void)); void dispatch_group_async_f(dispatch_group_t group, dispatch_queue_t queue, void *context, void (*function)(void *)); DESCRIPTION
A dispatch group is an association of one or more blocks submitted to dispatch queues for asynchronous invocation. Applications may use dis- patch groups to wait for the completion of blocks associated with the group. The dispatch_group_create() function returns a new and empty dispatch group. The dispatch_group_enter() and dispatch_group_leave() functions update the number of blocks running within a group. The dispatch_group_wait() function waits until all blocks associated with the group have completed, or until the specified timeout has elapsed. If the group becomes empty within the specified amount of time, the function will return zero indicating success. Otherwise, a non- zero return code will be returned. When DISPATCH_TIME_FOREVER is passed as the timeout, calls to this function will wait an unlimited amount of time until the group becomes empty and the return value is always zero. The dispatch_group_notify() function provides asynchronous notification of the completion of the blocks associated with the group by submit- ting the block to the specified queue once all blocks associated with the group have completed. The system holds a reference to the dispatch group while an asynchronous notification is pending, therefore it is valid to release the group after setting a notification block. The group will be empty at the time the notification block is submitted to the target queue. The group may either be released with dispatch_release() or reused for additional operations. The dispatch_group_async() convenience function behaves like so: void dispatch_group_async(dispatch_group_t group, dispatch_queue_t queue, dispatch_block_t block) { dispatch_retain(group); dispatch_group_enter(group); dispatch_async(queue, ^{ block(); dispatch_group_leave(group); dispatch_release(group); }); } RETURN VALUE
The dispatch_group_create() function returns NULL on failure and non-NULL on success. The dispatch_group_wait() function returns zero upon success and non-zero after the timeout expires. If the timeout is DISPATCH_TIME_FOREVER, then dispatch_group_wait() waits forever and always returns zero. MEMORY MODEL
Dispatch groups are retained and released via calls to dispatch_retain() and dispatch_release(). FUNDAMENTALS
The dispatch_group_async() and dispatch_group_notify() functions are wrappers around dispatch_group_async_f() and dispatch_group_notify_f() respectively. SEE ALSO
dispatch(3), dispatch_async(3), dispatch_object(3), dispatch_queue_create(3), dispatch_semaphore_create(3), dispatch_time(3) Darwin May 1, 2009 Darwin
All times are GMT -4. The time now is 06:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy