01-13-2016
In addition to what sea has already said, you need to provide a much clearer description of what you are trying to do. Are you looking for a single number that is the average value of the values all non-time, non-asterisk, non-empty, non-header fields? Are you looking for the average of values in each line? Are you looking for the average of values in each column? Are empty fields to be treated as zero and included in the average(s) or skipped?
At the very least, show us the output you hope to produce (in CODE tags) from the sample input you provided.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
Am new to scripting. So i just need your ideas to help me out. Here goes my requirement.
I have two csv files
1.csv 2.csv
abc,1.24 abc,1
def,2.13 def,1
I need to compare the first column of 1.csv with 2.csv and if matches then need to compare... (2 Replies)
Discussion started by: chinnahyd
2 Replies
2. Shell Programming and Scripting
SHELL SCRIPT
Hi,
I have a file in which contents are as follows:
9999,abdc,123
9988,aba_12,2323
and so on
I want to read the contents of this file such that i can do
echo "This is $a followed by $b an then $c"
I tried the following but id did not work
cat test | cut -d ',' -f1|... (7 Replies)
Discussion started by: mayanksargoch
7 Replies
3. Shell Programming and Scripting
I just want to know, how do we calculate the months in shell scripting.
If i give the input as 20-01-2011, the output should be 20-02-2011, 20-03-2011 or 20-04-2011........
How do i get this ?
Cheers. (6 Replies)
Discussion started by: sachin24
6 Replies
4. Shell Programming and Scripting
Enclosed is comma separated text file. I need to write a korn shell program that will parse the text file and insert the values into Oracle database.
I need to write the korn shell program on Red Hat Enterprise Linux server.
Oracle database is 10g. (15 Replies)
Discussion started by: shellguy
15 Replies
5. Shell Programming and Scripting
Hi All,
I need a shell script which could insert a sequence number column inside a dat file(pipe delimited).
I have the dat file similar to the one as shown below..
|A|B|C||D|E
|F|G|H||I|J
|K|L|M||N|O
|P|Q|R||S|T
As shown above, the column 4 is currently blank and i need to insert sequence... (5 Replies)
Discussion started by: nithins007
5 Replies
6. Shell Programming and Scripting
Hi,
I am trying to calculate avg response time on hourly basis from the log file which has millions of records.
As of now I am trying with creating temp file which will have lines with unique id and start time and end time and after that another script will run on this temp file to... (7 Replies)
Discussion started by: random_thoughts
7 Replies
7. Shell Programming and Scripting
Hello friends,
I have a file as follows:
"empty line"
content1
content2
content3
content1
content2
content3
content1
content2
content3
It starts with an empty line,
how can i get a csv like this: (12 Replies)
Discussion started by: kraterions
12 Replies
8. Shell Programming and Scripting
Hi,
I need to calculate the average of the following values using shell scripitng.
Can anyone please suggest a solution?
... (10 Replies)
Discussion started by: karan pratap si
10 Replies
9. Shell Programming and Scripting
Hi,
I need to remove first column from a csv file and i can do this by using below command.
cut -f1 -d, --complement Mytest.csv
I need to implement this in shell scripting, Whenever i am using the above command alone in command line it is working fine.
I have 5 files in my directory and... (3 Replies)
Discussion started by: Samah
3 Replies
10. Shell Programming and Scripting
I have input data looks like this which is a part of a csv file
7,1265,76548,"0102:04"
8,1266,76545,"0112:04"
I need to make the output data should look like this and the output data will be part of text file:
7|1265000 |7654899 |A|
8|12660000 |76545999 |B|
The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies
LEARN ABOUT ULTRIX
pnmconvol
pnmconvol(1) General Commands Manual pnmconvol(1)
NAME
pnmconvol - general MxN convolution on a portable anymap
SYNOPSIS
pnmconvol convolutionfile [pnmfile]
DESCRIPTION
Reads two portable anymaps as input. Convolves the second using the first, and writes a portable anymap as output.
Convolution means replacing each pixel with a weighted average of the nearby pixels. The weights and the area to average are determined by
the convolution matrix. The unsigned numbers in the convolution file are offset by -maxval/2 to make signed numbers, and then normalized,
so the actual values in the convolution file are only relative.
Here is a sample convolution file; it does a simple average of the nine immediate neighbors, resulting in a smoothed image:
P2
3 3
18
10 10 10
10 10 10
10 10 10
To see how this works, do the above-mentioned offset: 10 - 18/2 gives 1. The possible range of values is from 0 to 18, and after the off-
set that's -9 to 9. The normalization step makes the range -1 to 1, and the values get scaled correspondingly so they become 1/9 - exactly
what you want. The equivalent matrix for 5x5 smoothing would have maxval 50 and be filled with 26.
The convolution file will usually be a graymap, so that the same convolution gets applied to each color component. However, if you want to
use a pixmap and do a different convolution to different colors, you can certainly do that.
At the edges of the convolved image, where the convolution matrix would extend over the edge of the image, pnmconvol just copies the input
pixels directly to the output.
SEE ALSO
pnmsmooth(1), pnm(5)
AUTHORS
Copyright (C) 1989, 1991 by Jef Poskanzer.
Modified 26 November 1994 by Mike Burns, burns@chem.psu.edu
26 November 1994 pnmconvol(1)