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
CRYPT(3)						   BSD Library Functions Manual 						  CRYPT(3)

NAME
crypt, encrypt, setkey -- DES encryption SYNOPSIS
#include <unistd.h> char * crypt(const char *key, const char *salt); void encrypt(char *block, int edflag); #include <stdlib.h> void setkey(const char *key); DESCRIPTION
The crypt() function performs password encryption, based on the NBS Data Encryption Standard (DES). Additional code has been added to deter key search attempts. The first argument to crypt() is a null-terminated string, typically a user's typed password. The second is in one of two forms: if it begins with an underscore (``_''), an extended format is used in interpreting both the key and the salt value, as outlined below. Extended crypt: The key is divided into groups of 8 characters (the last group is null-padded) and the low-order 7 bits of each each character (56 bits per group) are used to form the DES key as follows: the first group of 56 bits becomes the initial DES key. For each additional group, the XOR of the encryption of the current DES key with itself and the group bits becomes the next DES key. The salt is a 9-character array consisting of an underscore, followed by 4 bytes of iteration count and 4 bytes of salt. These are encoded as printable characters, 6 bits per character, least significant character first. The values 0 to 63 are encoded as ``./0-9A-Za-z''. This allows 24 bits for both count and salt. Traditional crypt: The first 8 bytes of the key are null-padded, and the low-order 7 bits of each character is used to form the 56-bit DES key. The salt is a 2-character array of the ASCII-encoded salt. Thus, only 12 bits of salt are used. count is set to 25. Algorithm: The salt introduces disorder in the DES algorithm in one of 16777216 or 4096 possible ways (ie. with 24 or 12 bits: if bit i of the salt is set, then bits i and i+24 are swapped in the DES E-box output). The DES key is used to encrypt a 64-bit constant, using count iterations of DES. The value returned is a null-terminated string, 20 or 13 bytes (plus null) in length, consisting of the salt, followed by the encoded 64-bit encryption. The functions, encrypt() and setkey() provide access to the DES algorithm itself. setkey() is passed a 64-byte array of binary values (numeric 0 or 1). A 56-bit key is extracted from this array by dividing the array into groups of 8 and ignoring the last bit in each group. That bit is reserved for a byte parity check by DES, but is ignored by these functions. The block argument to encrypt() is also a 64-byte array of binary values. If the value of edflag is 0, block is encrypted; otherwise, it is decrypted. The result is returned in the original array block, after using the key specified by setkey() to process it. The function crypt() returns a pointer to the encrypted value on success, and NULL on failure. The crypt() and setkey() functions all manipulate the same key space. SEE ALSO
login(1), passwd(1), getpass(3), compat(5), passwd(5) LEGACY SYNOPSIS
#include <unistd.h> int encrypt(char *block, int edflag); The function encrypt() returns 0 on success and 1 on failure. void setkey(const char *key); The include file <unistd.h> is necessary and sufficient for the setkey() function. BUGS
The crypt() function returns a pointer to static data, and subsequent calls to crypt() will modify the same object. HISTORY
A rotor-based crypt() function appeared in Version 6 AT&T UNIX. The current style crypt() first appeared in Version 7 AT&T UNIX. This library (FreeSec 1.0) was developed outside the United States of America as an unencumbered replacement for the U.S.-only libcrypt encryption library. Programs linked against the crypt() interface may be exported from the U.S.A. only if they use crypt() solely for authentication purposes and avoid use of the other programmer interfaces listed above. Special care has been taken in the library so that programs which only use the crypt() interface do not pull in the other components. AUTHOR
David Burren <davidb@werj.com.au> FreeSec 1.0 March 9, 1994 FreeSec 1.0
All times are GMT -4. The time now is 10:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy