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
DH_USRLOCAL(1) Debhelper DH_USRLOCAL(1)
NAME
dh_usrlocal - migrate usr/local directories to maintainer scripts
SYNOPSIS
dh_usrlocal [debhelperoptions] [-n]
DESCRIPTION
dh_usrlocal is a debhelper program that can be used for building packages that will provide a subdirectory in /usr/local when installed.
It finds subdirectories of usr/local in the package build directory, and removes them, replacing them with maintainer script snippets
(unless -n is used) to create the directories at install time, and remove them when the package is removed, in a manner compliant with
Debian policy. These snippets are inserted into the maintainer scripts by dh_installdeb. See dh_installdeb(1) for an explanation of
debhelper maintainer script snippets.
When the Rules-Requires-Root field is not (effectively) binary-targets, the directories in /usr/local will have ownership root:staff and
the mode will be 02775. These values have been chosen to comply with the recommendations of the Debian policy for directories in
/usr/local.
When Rules-Requires-Root has an effective value of binary-targets, the owners, groups and permissions will be preserved with one exception.
If the directory is owned by root:root, then ownership will be reset to root:staff and mode will be reset to 02775. This is useful, since
that is the group and mode policy recommends for directories in /usr/local.
OPTIONS
-n, --no-scripts
Do not modify postinst/prerm scripts.
NOTES
Note that this command is not idempotent. dh_prep(1) should be called between invocations of this command. Otherwise, it may cause multiple
instances of the same text to be added to maintainer scripts.
CONFORMS TO
Debian policy, version 2.2
SEE ALSO
debhelper(7)
This program is a part of debhelper.
AUTHOR
Andrew Stribblehill <ads@debian.org>
11.1.6ubuntu2 2018-05-10 DH_USRLOCAL(1)