10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello. Trying to add a column of numbers and combine the 1st and 2nd fields as uniq with the new total.
This works to add the numbers but can't figure an easy was to combine the 1st and 2nd column as the list is very long. awk '{s+=$3} END {print s}'
bird dog 300
bird dog 100
cat clown 200... (1 Reply)
Discussion started by: jimmyf
1 Replies
2. Shell Programming and Scripting
So I have this input
1 10327 rs112750067 T C . PASS DP=65;AF=0.208;CB=BC,NCBI
1 10469 rs117577454 C G . PASS DP=2055;AF=0.020;CB=UM,BC,NCBI
1 10492 rs55998931 C T . PASS DP=231;AF=0.167;CB=BC,NCBI
1 10583 rs58108140 G A ... (3 Replies)
Discussion started by: kellywilliams
3 Replies
3. Shell Programming and Scripting
Given a file test.txt ,I can get a list of numbers in a single column using the command :
cat test.txt | cut -d ' ' -f 8 that gives the output as
52
52
52
60
52
How can I get the sum of all the numbers in that column that is displayed?
i want the output as
sum=268 (4 Replies)
Discussion started by: hitha87
4 Replies
4. Shell Programming and Scripting
Hi All
I do have a file like this with 6 columns. Groups of data merge together and the group number is indicated above each group.
1
1 12 26 289 3.2e-027 GCGTATGGCGGC
2 12 26 215 6.7e+006 TTCCACCTTTTG
3 9 26 175 ... (1 Reply)
Discussion started by: Lucky Ali
1 Replies
5. Shell Programming and Scripting
I have a file in the following format. Groups of data merge together and the group number is indicated above each group.
1
adrf
dfgr
dfg
2
dfgr
dfgr
3
dfef
dfr
fd
4
fgrt
fgr
fgg
5
fgrt
fgr (3 Replies)
Discussion started by: Lucky Ali
3 Replies
6. Shell Programming and Scripting
Problem discription:
I have many files which contain the same lines.
for instance, (15 lines) file1 ..last column add by hand arbitrarily.
1.78116800 0.68396600 0.00061900
0.47641600 -0.49794500 -0.00024000
-1.70662800 0.29577100 0.67863600
-1.70647600 0.29654600 ... (9 Replies)
Discussion started by: liuzhencc
9 Replies
7. UNIX for Dummies Questions & Answers
I have UWIn version of Unix for Desktop.
I have a file (Subtitle file of a movie) with the following format
abc def ghi jkl
mno pqr stuv
uvw xyz
The subtitles are delayed about a min or few seconds more. I want to increase it to be as shown below:
abc def ghi jkl
mno pqr stuv
... (4 Replies)
Discussion started by: bobbygsk
4 Replies
8. Shell Programming and Scripting
This is my script. I am pulling the status of some hard where, but the status is in numerical form. The number 4 means Major and the 5 means Critical. In my script I would like to show the alarm type in aplha rather than numeric form. So if instead of seeing a 4 or 5 you would see MAjor or... (11 Replies)
Discussion started by: ja156194
11 Replies
9. UNIX for Advanced & Expert Users
Hello, I have a file, and one column has both positive and negative numbers. Does anyone know how I can calculate the total of all the values (i.e, +ve and -ve).
eg:
col1 col2 col3
data 23 data
data 76 data
data -30 data
Thanks
Khoom (1 Reply)
Discussion started by: Khoomfire
1 Replies
10. Shell Programming and Scripting
Hi,
i want to sum all nubers in one column. Example:
12.23
11
23.01
3544.01
I'm trying to do this in awk, but it doesn't work properly.
Seems like awk is summing only integers, for example:
12
11
23
3544
It cuts off numbers after dot.
I used this command:
akw /text/ file.txt |nawk... (1 Reply)
Discussion started by: iahveh
1 Replies