06-04-2014
What would be the desired output for that sample data?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have a small requirement where i need to sum up a column in a text file.
Input file
66ab 000000 534385 -00000106350.00
66cd 000000 534485 -00013364511.00
66ad 000000 534485 -00000426548.00
672a 000000 534485 000000650339.82... (5 Replies)
Discussion started by: pssandeep
5 Replies
2. Shell Programming and Scripting
Hi,
I am using the following code to find the sum of the values of column 286 in a file. It will have the Decimal values with the scale of 2. Delimiter is '|^'
cut -d'|^' -f286 filename|cut -c3-| awk '{ x += $1 } END { printf("%.2f\n", x) }'
There are around 50k records in this file... (2 Replies)
Discussion started by: Jram
2 Replies
3. Shell Programming and Scripting
Input file:
2
10
15
20
24
Output file
2 8 NNNNNNNN
10 5 NNNNN
15 5 NNNNN
20 4 NNNN
24
Do anybody experience subtraction column by column and print out number of subtraction times with N?
The second column of the output file is the subtraction of 10-2 = 8; The third column just... (3 Replies)
Discussion started by: perl_beginner
3 Replies
4. Shell Programming and Scripting
I have a file (let say file B) like this:
File B:
A1 3 5
A1 7 9
A2 2 5
A3 1 3
The first column defines a filename and the other two define a range in that specific file. In the same directory, I have also three more files (File A1, A2 and A3). Here is 10 sample lines... (3 Replies)
Discussion started by: Bastami
3 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
I have a requirement where I need to find sum of values from column D through O present in a CSV file and check whether the sum of each Individual column matches with the value present for that corresponding column present in the trailer record.
For example, let's assume for column D... (9 Replies)
Discussion started by: tpk
9 Replies
6. Shell Programming and Scripting
My input is:
a.txt computer
b.txt
c.txt
e.txt
I want my output to be:
a.txt computer
b.txt computer
c.txt computer
e.txt computer
There are about 100000 text files having the same format as my input data. What I am doing now is too slow and also requires plenty of scripts.
1. wc -l all... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies
7. 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... (1 Reply)
Discussion started by: as7951
1 Replies
8. 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
9. UNIX for Beginners Questions & Answers
I have two files, file1.table is the count table, and the other is the range condition file2.range.
file1.table
chr start end count
N1 0 48 1
N1 48 181 2
N1 181 193 0
N1 193 326 2
N1 326 457 0
N1 457 471 1
N1 471 590 2
N1 590 604 1
N1 604 752 1
N1 752 875 1
file2.range... (12 Replies)
Discussion started by: yifangt
12 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
I have a file as below and want to sum based on the id in the first column
Input
10264;ATE; 12
10265;SES;11
10266AUT;50
10264;ATE;10
10265;SES;13
10266AUT;89
10264;ATE;1
10265;SES;15
10266AUT;78
Output
10264;ATE; 23
10265;SES;39
10266AUT;139 (6 Replies)
Discussion started by: arunkumar_mca
6 Replies