10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
My input file
Gene1 1
Gene1 2
Gene1 3
Gene1 0
Gene2 0
Gene2 0
Gene2 4
Gene2 8
Gene3 9
Gene3 9
Gene4 0
Condition:
If the first column matches, then look in the second column. If there is a value of zero in the second column, then don't consider that record while averaging.
... (5 Replies)
Discussion started by: jacobs.smith
5 Replies
2. 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
3. UNIX for Dummies Questions & Answers
Hi,
I am searching for an awk-script that computes the mean values for the $2 column, but addicted to the values in the $1 column. It also should delete the unnecessary lines after computing...
An example (for some reason I cant use the code tag button):
cat list.txt
1 10
1 30
1 20... (2 Replies)
Discussion started by: bjoern456
2 Replies
4. Shell Programming and Scripting
Hi,
I would like to calculate the average of column 'y' based on the value of column 'pos'.
For example, here is file1
id pos y c
11 1 220 aa
11 4333 207 f
11 5333 112 ee
11 11116 305 e
11 11117 310 r
11 22228 781 gg
11 ... (2 Replies)
Discussion started by: jackken007
2 Replies
5. UNIX for Dummies Questions & Answers
I have a table, say this:
name1 num1 num2 num3 num4
name2 num5 num6 num7 num8
name3 num1 num3 num4 num9
name2 num8 num9 num1 num2
name2 num4 num5 num6 num4
name4 num4 num5 num7 num8
name5 num1 num3 num9 num7
name5 num6 num8 num3 num4
I want a code that will sort my data according... (4 Replies)
Discussion started by: FelipeAd
4 Replies
6. Shell Programming and Scripting
Hi All,
I need the modification for the below mentioned code (found in one more post https://www.unix.com/shell-programming-scripting/27161-script-generate-average-values.html) to find the average values for all the columns(but for a specific rows) and print the averages side by side.
I have... (4 Replies)
Discussion started by: ks_reddy
4 Replies
7. Shell Programming and Scripting
Hi i have data with two columns like below.
I want to find average of column values like if the value in column 2 is between 0-250000 the average of column 1 is some xx and average of column2 is ww then if value is 250001-5000000 average of column 1 is yy and average of column 2 is zz.
And my... (5 Replies)
Discussion started by: bhargavpbk88
5 Replies
8. Shell Programming and Scripting
Hello,
Let's assume I have 100 files FILE_${m} (0<m<101). Each of them contains 100 lines and 10 columns.
I'd like to get in a file called "result" the average value of column 3, ONLY between lines 11 and 17, in order to plot that average as a function of the parameter m.
So far I can compute... (6 Replies)
Discussion started by: DMini
6 Replies
9. UNIX for Dummies Questions & Answers
Hi
I am looking for an awk script which can compute the average of the last column based on the date and time. The file looks:
site1,"2000-01-01 00:00:00", "2000-01-01 00:59:00",0.013
site2,"2000-02-01 01:00:00", "2000-02-01 01:59:00",0.035
site1,"2000-02-01 02:00:00", "2000-02-01... (15 Replies)
Discussion started by: kathy wang
15 Replies
10. UNIX for Dummies Questions & Answers
Suppose I have 500 files in a directory and I need to Use awk to calculate average of column 3 for each of the file, how would I do that? (6 Replies)
Discussion started by: grossgermany
6 Replies