05-05-2018
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have some data that is something like this?
item: onhand counted location
ITEM0001 1 0 a1
ITEM0001 0 1 a2
ITEM0002 5 0 b5
ITEM0002 0 6 c1
I want to sum up... (6 Replies)
Discussion started by: syadnom
6 Replies
2. Shell Programming and Scripting
i have a file - it will be in sorted order on column 1
abc 0 1
abc 2 3
abc 3 5
def 1 7
def 0 1
--------
i'd like (awk maybe?) to get the results (any ideas)???
abc 5 9
def 1 8 (2 Replies)
Discussion started by: jjoe
2 Replies
3. UNIX for Dummies Questions & Answers
Hi
In a tab delimited file how can I add a column that have values concatenated from all columns.
For example
input.txt
test1 test2 test3
zz2 mm uu
pp3 yy kk
ss2 tt ll
zz3 mm uu
pp23 yy kk
ss3 tt ll
11e 22 44
33c 22 99
output.txt
test1 test2 test3 reslt (6 Replies)
Discussion started by: mary271
6 Replies
4. Shell Programming and Scripting
Hi Experts ,
we have a CDC file where we need to get the latest record of the Key columns
Key Columns will be CDC_FLAG and SRC_PMTN_I
and fetch the latest record from the CDC_PRCS_TS
Can we do it with a single awk command.
Please help.... (3 Replies)
Discussion started by: vijaykodukula
3 Replies
5. Shell Programming and Scripting
Hi,
I have a similar input format-
A_1 2
B_0 4
A_1 1
B_2 5
A_4 1
and looking to print in this output format with headers. can you suggest in awk?awk because i am doing some pattern matching from parent file to print column 1 of my input using awk already.Thanks!
letter number_of_letters... (5 Replies)
Discussion started by: prashob123
5 Replies
6. Shell Programming and Scripting
Input :-
Hd1;Hd2:hd3;Hd4;Hd5
X;1;2;3;4
Y;2;3;5;6
Z;3;5;6;7
X;10;11;24;16
Y;11;23;21;1
Z;10;13;14;15
X;0;1;2;0
K;0;0;0;0
K;0;0;0;0
I want Sum Data base on first column;
Hd1;Hd2:hd3;Hd4;Hd5
X;11;14;29;20
Y;12;26;26;7
Z;13;18;20;22
K;0;0;0;0 (4 Replies)
Discussion started by: pareshkp
4 Replies
7. Shell Programming and Scripting
Hi,
I have 2 csv files.
a.csv
HUAWEI,20LMG011_DEKET_1296_RTN-980_IDU-1-11-ISV3-1(to LAMONGAN_M),East_Java,20LMG011_DEKET_1296_RTN-980_IDU-1,20LMG011,20LMG
027_1287_LAMONGAN_RTN980_IDU1,20LMG027,1+1(HSB),195.675,20LMG011-20LMG027,99.9995,202.6952012... (7 Replies)
Discussion started by: tententen
7 Replies
8. Shell Programming and Scripting
Hi Experts,
Please bear with me, i need help
I am learning AWk and stuck up in one issue.
First point : I want to sum up column value for column 7, 9, 11,13 and column15 if rows in column 5 are duplicates.No action to be taken for rows where value in column 5 is unique.
Second point : For... (12 Replies)
Discussion started by: as7951
12 Replies
9. Shell Programming and Scripting
Please help me to get required output for both scenario 1 and scenario 2 and need separate code for both scenario 1 and scenario 2
Scenario 1
i need to do below changes only when column1 is CR and column3 has duplicates rows/values. This inputfile can contain 100 of this duplicated rows of... (1 Reply)
Discussion started by: as7951
1 Replies
10. UNIX for Beginners Questions & Answers
I have a file abc.csv, from which I need column 24(PurchaseOrder_TotalCost) to get the sum_of_amounts with date and row count into another file say output.csv
abc.csv-
UTF-8,,,,,,,,,,,,,,,,,,,,,,,,,
... (6 Replies)
Discussion started by: Tahir_M
6 Replies
LEARN ABOUT DEBIAN
numsum
NUMSUM(1) User Contributed Perl Documentation NUMSUM(1)
NAME
numsum - numsum program file
SYNOPSIS
numsum [-iIcdhrsvxy] <FILE>
| numsum [-iIcdhrsvxy] (Input on STDIN from pipeline.)
numsum [-iIcdhrsvxy] (Input on STDIN. Use Ctrl-D to stop.)
DESCRIPTION
numsum will take all the numbers on stdin and return the sum of those numbers. Currently it only processes the first number on each line.
Besides positive numbers, it also handles negative numbers and numbers with decimals.
OPTIONS
-i Only return the integer portion of the final sum.
-I Only return the decimal portion of the final sum.
-c Print out the sum of each column.
-r Print out the sum of each row.
-x <n> Specify a comma seperated list of columns to print.
-y <n> Specify a comma seperated list of rows to print.
-s <string> Specify a string to use as a seperator for columns.
This defaults to be consecutive whitespace (s+).
-h Help: You're looking at it.
-V Increase verbosity.
-d Debug mode. For developers
-q Quiet mode, don't print any warnings.
EXAMPLES
Simply add up the numbers in a file.
$ numsum numbers.txt
4315
Enter your own numbers on STDIN. The last number is the answer.
$ numsum
4
21
98
100
223
Use it in a command pipeline.
$ ls -1s | grep .mp3 | numsum -c -x 5
72288
Add up the total byte count in a http log file.
$ cat access_log | awk {'print $10'} numsum
or
numsum -c -x 10 access_log
Add up the columns of numbers of a file.
$ cat columns
1 6 11 16 21
2 7 12 17 22
3 8 13 18 23
4 9 14 19 24
5 10 15 20 25
$ numsum -c columns
15 40 65 90 115
Add up the 1st, 2nd and 5th columns only.
$ numsum -c -x 1,2,5 columns
15 40 115
Add up the rows of numbers of a file.
$ numsum -r columns
55
60
65
70
75
Add up the 2nd and 4th rows.
$ numsum -r -y 2,4 columns
60
70
SEE ALSO
numaverage(1), numbound(1), numinterval(1), numnormalize(1), numgrep(1), numprocess(1), numrandom(1), numrange(1), numround(1)
COPYRIGHT
numsum is part of the num-utils package, which is copyrighted by Suso Banderas and released under the GPL license. Please read the COPYING
and LICENSE files that came with the num-utils package
Developers can read the GOALS file and contact me about providing
submitions or help for the project.
MORE INFO
More info on numsum can be found at:
http://suso.suso.org/programs/num-utils/
perl v5.10.1 2009-10-31 NUMSUM(1)