Hi
I wanted to write a shell script with an if condition
Example
MinValue=10
MaxValue=30
logvalue = some integer value that script reads from the command line arguement
I wanted to check whether log value greater than or equal to10 and less than equal to 30
and proceed with the rest of... (5 Replies)
hello friends...:-)
i need some help
i have a file cantain like this
Star1 ,NetWork,09/02/2008
Star1 ,NetWork,10/02/2008
Star1 ,NetWork,11/02/2008
Star2 ,NetWork,08/03/2008
Star2 ,NetWork,09/04/2008
Star2 ,NetWork,10/05/2008
i need to find out min, max dates
the output look like... (6 Replies)
hi, i have an awk script and I managed to figure out how to search the max value but Im having difficulty in searching for the min field value.
BEGIN {FS=","; max=0}
NF == 7 {if (max < $6) max = $6;}
END { print man, min}
where $6 is the column of a field separated by a comma (3 Replies)
Hi ,
Below is my sample data,I have this 8 column(A,B,C,D,E,F,G,H) in csv file.
A , B ,C ,D ,E ,F,G ,H
4141,127337,24,15,20,69,72.0,-3
4141,128864,24,15,20,65,66.0,-1
4141,910053,24,15,4,4,5.0,-1
4141,910383,24,15,22,3,4.0,-1
4141,496969,24,15,14,6,-24.0,-18... (7 Replies)
Hello Experts,
I have got a txt files which has multiple columns, I want to get the max, min and diff (max-min) for each column in the same txt file. Example:
cat file.txt
a 1 4
b 2 5
c 3 6
I want ouput like:
cat file.txt
a 1 4
b 2 5
c 3 6
Max 3 6
Min 1 4
Diff 2 2
awk 'min=="" ||... (4 Replies)
Hi guys,
I already search on the forum but i can't solve this on my own.
I have a lot of files like this:
And i need to print the line with the maximum value in last column but if the value is the same (2 in this exemple for the 3 last lines) i need get the line with the minimum value in... (4 Replies)
aaa: 3 ms
aaa: 2 ms
aaa: 5 ms
aaa: 10 ms
..........
to get the 3 2 5 10 ...'s min avg and max
something like
min: 2 ms avg: 5 ms max: 10 ms (2 Replies)
I need to find the max/min of columns 1 and 2 of a 2 column file what contains the special character ">".
I know that this will find the max value of column 1.
awk 'BEGIN {max = 0} {if ($1>max) max=$1} END {print max}' input.file
But what if I needed to ignore special characters in the... (3 Replies)
Hi,
I need your kind help to get min and max values from file based on value in $5 .
File1
SP12.3 stc 2240806 2240808 + ID1_N003 ID2_N003T0
SP12.3 sto 2241682 2241684 + ID1_N003 ID2_N003T0
SP12.3 XE 2239943 2240011 + ID1_N003 ID2_N003T0
SP12.3 XE 2240077 2241254 + ID1_N003 ... (12 Replies)
You have a log file as attached in sample input with various operations and time taken by each of them. Write a script to find the min and max time taken for each operation. Sample output is attached.
Sample Input is given as below:
operation1,83621
operation2,72321
operation3,13288... (1 Reply)
Discussion started by: Chandan_Bose
1 Replies
LEARN ABOUT PLAN9
add
ADD(2) System Calls Manual ADD(2)NAME
add, sub, mul, div, raddp, rsubp, rmul, rdiv, rshift, inset, rcanon, eqpt, eqrect, ptinrect, rectinrect, rectXrect, rectclip, Dx, Dy, Pt,
Rect, Rpt - arithmetic on points and rectangles
SYNOPSIS
#include <u.h>
#include <libc.h>
#include <libg.h>
Point add(Point p, Point q)
Point sub(Point p, Point q)
Point mul(Point p, int a)
Point div(Point p, int a)
Rectangle raddp(Rectangle r, Point p)
Rectangle rsubp(Rectangle r, Point p)
Rectangle rmul(Rectangle r, int a)
Rectangle rdiv(Rectangle r, int a)
Rectangle rshift(Rectangle r, int a)
Rectangle inset(Rectangle r, int n)
Rectangle rcanon(Rectangle r)
int eqpt(Point p, Point q)
int eqrect(Rectangle r, Rectangle s)
int ptinrect(Point p, Rectangle r)
int rectinrect(Rectangle r, Rectangle s)
int rectXrect(Rectangle r, Rectangle s)
int rectclip(Rectangle *rp, Rectangle b)
int Dx(Rectangle r)
int Dy(Rectangle r)
Point Pt(int x, int y)
Rectangle Rect(int x0, int y0, int x1, int y1)
Rectangle Rpt(Point p, Point q)
DESCRIPTION
The functions Pt, Rect and Rpt construct geometrical data types from their components. These are implemented as macros.
Add returns the Point sum of its arguments: Pt(p.x+q.x, p.y+q.y). Sub returns the Point difference of its arguments: Pt(p.x-q.x, p.y-q.y).
Mul returns the Point Pt(p.x*a, p.y*a). Div returns the Point Pt(p.x/a, p.y/a).
Raddp returns the Rectangle Rect(add(r.min, p), add(r.max, p)); rsubp returns the Rectangle Rpt(sub(r.min, p), sub(r.max, p)). Rmul
returns the Rectangle Rpt(mul(r.min,a), mul(r.max,a)); Rdiv returns the Rectangle Rpt(div(r.min,a), div(r.max,a)).
Rshift returns the rectangle r with all coordinates either left-shifted or right-shifted by a, depending on whether a is positive or nega-
tive, respectively.
Inset returns the Rectangle Rect(r.min.x+n, r.min.y+n, r.max.x-n, r.max.y-n).
Rcanon returns a rectangle with the same extent as r, canonicalized so that min.x <= max.x, and min.y <= max.y.
Eqpt compares its argument Points and returns 0 if unequal, 1 if equal. Eqrect does the same for its argument Rectangles.
Ptinrect returns 1 if p is a point within r, and 0 otherwise.
Rectinrect returns 1 if all the pixels in r are also in s, and 0 otherwise.
RectXrect returns 1 if r and s share any point, and 0 otherwise.
Rectclip clips in place the Rectangle pointed to by rp so that it is completely contained within b. The return value is 1 if any part of
*rp is within b. Otherwise, the return value is 0 and *rp is unchanged.
The functions Dx and Dy give the width (x) and height (y) of a Rectangle. They are implemented as macros.
SOURCE
/sys/src/libg
SEE ALSO graphics(2)ADD(2)