10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
i have a file with 2 columns. i want to calculate the average of column 1 based on the values of column 2. here's how the file looks like. i want to calculate the sums of numbers corresponding to 1 and then calculate the average. same for numbers corresponding to zero. any help with a code would... (1 Reply)
Discussion started by: onerokeyz
1 Replies
2. Shell Programming and Scripting
I am trying to use awk to calculate the average of all lines in $2 for every file in a directory. The below bash seems to do that, but I cannot figure out how to capture the string before the _ as the output file name and have it be tab-delimeted. Thank you :).
Filenames in... (3 Replies)
Discussion started by: cmccabe
3 Replies
3. Shell Programming and Scripting
awk '{if(len==0){last=$4;total=$6;len=1;getline}if($4!=last){printf("%s\t%f\n", last, total/len);last=$4;total=$6;len=1}else{total+=$6;len+=1}}END{printf("%s\t%f\n", last, total/len)}' exon.txt > output.txt
In the attached file I am just trying to group all the same names in column $4 and then... (2 Replies)
Discussion started by: cmccabe
2 Replies
4. Shell Programming and Scripting
Hi ,
Every day I'll get a file, in that I have to match today's file(20130619) third column to previous files (20130618,20130617), that is 124 present in previous files or not. If it matches then I have take the average values of 5th column of 124 from yesterdays and day before yesterdays file,... (5 Replies)
Discussion started by: Shenbaga.d
5 Replies
5. Shell Programming and Scripting
Dear friends,
I'm stuck with the task below, I would be thankful for all your replies.
INPUT :
Date Price Volume
20110601 73052811.61 2845833
20110602 61489062.96 9909230
20110603 72790724.65 1108927
20110606 48299507.20 7435881
20110607 ... (5 Replies)
Discussion started by: hernand
5 Replies
6. Shell Programming and Scripting
Hi!
i have a new shell script that will compute for a value...
a = b/(b+c)
c = d/(d+e)
print b" "a" "d" "c
but there will be an instance that either b+c or d+e will be "0".... if b+c or d+e is "0" it will print "#NA#...
pls help me... thanks! (10 Replies)
Discussion started by: kingpeejay
10 Replies
7. Programming
I have a file which is
2
3
4
5
6
6
so i am writing program in C to calculate mean..
#include<stdio.h>
#include<string.h>
#include <math.h>
double CALL mean(int n , double x)
main (int argc, char **argv)
{
char Buf,SEQ;
int i;
double result = 0;
FILE *fp; (3 Replies)
Discussion started by: cdfd123
3 Replies
8. Shell Programming and Scripting
Hi Friends,
Can any one help me with count average of student marks in this file (i can not change structure of the input file):
input file:
1:John Smith:2 3 4 5
2:Mark Anderson:3 2
3:Susan Waterman:2 4 2
(numbers of marks are different)
output:
Name:John Smith
ID#: 1
Avg. mark:... (6 Replies)
Discussion started by: mleplawy
6 Replies
9. Shell Programming and Scripting
hi
iam facing problem for divided (%) arthemtic function in for condition.
tell me reply and all the arthemtic function in one scripting . (2 Replies)
Discussion started by: naveeng.81
2 Replies
10. UNIX for Dummies Questions & Answers
If I have a file like this, could anyone please guide me how to find the average value in each metrix. The file has got about 130,000 metrixs.
Grid-ref= 142, 235
178 182 203 240 273 295 289 293 283 262 201 176
167 187 187 246 260 282 299 312 293 276 230 191
169 ... (2 Replies)
Discussion started by: su_in99
2 Replies
list directory(1m) list directory(1m)
NAME
list directory - Displays a list of all the directories whose names match the specified directory name
SYNOPSIS
cdscp list directory directory-name [with attribute-name = attribute-value]
ARGUMENTS
The full name of a specific directory. The last simple name can contain wildcard characters. The name of a particular attribute. The
value of a particular attribute.
DESCRIPTION
The list directory command displays a list of all the directories whose names match the specified directory name. The last simple name can
contain wildcards. You can use a with attribute-name = attribute-value clause to limit output only to directories whose attributes have
values equal to the specified values. A space must precede and follow the = (equals sign).
Privilege Required
You must have read permission to the parent directory. If you use a with attribute-name = attribute-value clause in the command, you also
need read or test permission to the selected directories.
NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE.
EXAMPLE
The following command displays the names of all the directories in the /.:/sales directory: cdscp> list directory /.:/sales/*
LIST
DIRECTORY /.../abc.com/sales
AT 1991-10-15-15:43:58 atlanta austin boston chicago ontario ny seattle
RELATED INFORMATION
Commands: add directory(1m), create directory(1m), delete directory(1m), remove directory(1m), set directory(1m), set directory to
skulk(1m), show directory(1m)
list directory(1m)