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. UNIX for Dummies Questions & Answers
Hi
I have file like below
111,victor,48,12,36
342,Peter,54,58,30
476,Scott,25,36,48
567,Patty,74,17,95
I have written below code to calcualte avereage for every id
Victor = 48+12+36/3
#!/bin/ksh
/usr/xpg4/bin/awk '
BEGIN {FS=","} {sum=0; n=0;i=3 (1 Reply)
Discussion started by: stew
1 Replies
3. Shell Programming and Scripting
I am trying to write a loop script in bash thru umbuntu for the following:
ask for a password
if wrong show a message
if wright then asks for 3 numbers from you
then calculates the average of them
at the end it saves the average and the date of the calculation in a text file and then zips it.... (1 Reply)
Discussion started by: redmond1212
1 Replies
4. Shell Programming and Scripting
Hi
i have data like - Fieldseperator is "\t" -..
...
05/18/12-23:40 12.0647 96.4762 140.746 19.4222 38.0837 17.1549
05/18/12-23:50 11.9463 97.7457 139.447 20.4776 29.8511 17.0144
05/19/12-00:00 11.6922 94.7384 130.364 18.5693 28.28 15.6425
05/19/12-00:10 10.8512 87.547 113.844... (11 Replies)
Discussion started by: IMPe
11 Replies
5. Shell Programming and Scripting
Hello,
is it possible to give grep two documents to surche for? like
grep "test" /home/one.txt AND /home/two.txt ?
thanks (1 Reply)
Discussion started by: Cybertron
1 Replies
6. UNIX for Dummies Questions & Answers
Hi,
i have 12 float variables in a bash file and i want to calculate the average of them.
Can any body help? (6 Replies)
Discussion started by: limadario
6 Replies
7. Shell Programming and Scripting
Hi
I am looking for an awk script which can compute average of all the fields every 5th line. The file looks:
A B C D E F G H I J K L M
1 18 13 14 12 14 13 11 12 12 15 15 15
2 17 17 13 13 13 12 12 11 12 14 15 14
3 16 16 12 12 12 11 11 12 11 16 14 13
4 15 15 11 11 11 12 11 12 11... (6 Replies)
Discussion started by: saint2006
6 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. 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
10. Shell Programming and Scripting
This is the cronjob
----------------------
root@a7germ:/home/paxtemp > crontab -l|grep test
57 * * * * /home/paxtemp/test_1.sh
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/paxtemp/test.sh
root@a7germ:/home/paxtemp >
This is the contents of test.sh script... (2 Replies)
Discussion started by: kekanap
2 Replies