Sponsored Content
Top Forums Shell Programming and Scripting how to find min, max dates in a file Post 302175877 by radoulov on Sunday 16th of March 2008 01:59:23 PM
Old 03-16-2008
Another Awk solution:

Code:
awk 'END { for (k in min) 
printf "%s %s\n%s %s\n\n", 
k, min[k], k, max[k] }
!x[$1]++ { min[$1] = $3 }
fmtd($3) > fmtd(max[$1]) { max[$1] = $3 }
fmtd($3) < fmtd(min[$1]) { min[$1] = $3 } 
func fmtd(dt) { split(dt, t, "/") 
  return t[3]t[1]t[2] 
}' FS="," file

Use nawk or /usr/xpg4/bin/awk on Solaris.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

min and max value of process id

We are running a AIX 5.2 OS. Would anyone happen to know what the max value for a process id could be? Thanks jerardfjay :) (0 Replies)
Discussion started by: jerardfjay
0 Replies

2. UNIX for Dummies Questions & Answers

How to find whenther given value is in betwwen min and Max in unix shell scripting

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)
Discussion started by: pinky
5 Replies

3. Shell Programming and Scripting

To get max/min Date/Timestamp from a file

I want to get maximum/minimum date/timestamp from a data file ? Sample Input File ============= rec#,order_dt,ext_ts 1,2010-12-01,2010-12-01 17:55:23.222222 2,2011-11-05,2010-12-01 19:55:23.222222 3,2009-10-01,2010-12-01 18:55:23.222222 for above file Maximum Order_dt = 2011-11-05... (5 Replies)
Discussion started by: vikanna
5 Replies

4. Shell Programming and Scripting

Find min.max value if matching columns found using AWK

Input_ File : 2 3 4 5 1 1 0 1 2 1 -1 1 2 1 3 1 3 1 4 1 6 5 6 6 6 6 6 7 6 7 6 8 5 8 6 7 Desired output : 2 3 4 5 -1 1 4 1 6 5 6 8 5 8 6 7 (3 Replies)
Discussion started by: vasanth.vadalur
3 Replies

5. Shell Programming and Scripting

How to find the average,min,max ,total count?

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)
Discussion started by: vinothsekark
7 Replies

6. Shell Programming and Scripting

to find min and max value for each column!

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)
Discussion started by: dixits
4 Replies

7. Homework & Coursework Questions

Min/Max/counter/while loop from file

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: The program is supposed to read in text from a given file ( different samples provided in the homework but not... (1 Reply)
Discussion started by: c++newb
1 Replies

8. Shell Programming and Scripting

Average, min and max in file with header, using awk

Hi, I have a file which looks like this: FID IID MISS_PHENO N_MISS N_GENO F_MISS 12AB43131 12AB43131 N 17774 906341 0.01961 65HJ87451 65HJ87451 N 10149 906341 0.0112 43JJ21345 43JJ21345 N 2826 906341 0.003118I would... (11 Replies)
Discussion started by: kayakj
11 Replies

9. Shell Programming and Scripting

awk script to find min and max value

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)
Discussion started by: ncwxpanther
3 Replies

10. Shell Programming and Scripting

Find min and max time taken from a log file

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
QwtSymbol(3)							 Qwt User's Guide						      QwtSymbol(3)

NAME
QwtSymbol - A class for drawing symbols. SYNOPSIS
#include <qwt_symbol.h> Public Types enum Style { NoSymbol = -1, Ellipse, Rect, Diamond, Triangle, DTriangle, UTriangle, LTriangle, RTriangle, Cross, XCross, HLine, VLine, Star1, Star2, Hexagon, StyleCnt } Public Member Functions const QBrush & brush () const virtual QwtSymbol * clone () const void draw (QPainter *p, const QPoint &pt) const void draw (QPainter *p, int x, int y) const virtual void draw (QPainter *p, const QRect &r) const bool operator!= (const QwtSymbol &) const virtual bool operator== (const QwtSymbol &) const const QPen & pen () const QwtSymbol (Style st, const QBrush &bd, const QPen &pn, const QSize &s) QwtSymbol () void setBrush (const QBrush &b) void setPen (const QPen &p) void setSize (int a, int b=-1) void setSize (const QSize &s) void setStyle (Style s) const QSize & size () const Style style () const virtual ~QwtSymbol () Detailed Description A class for drawing symbols. Member Enumeration Documentation enum QwtSymbol::Style Style See also: setStyle(), style() Constructor &; Destructor Documentation QwtSymbol::QwtSymbol () Default Constructor The symbol is constructed with gray interior, black outline with zero width, no size and style 'NoSymbol'. QwtSymbol::QwtSymbol (QwtSymbol::Stylestyle, const QBrush &brush, const QPen &pen, const QSize &size) Constructor. Parameters: style Symbol Style brush brush to fill the interior pen outline pen size size QwtSymbol::~QwtSymbol () [virtual] Destructor. Member Function Documentation const QBrush& QwtSymbol::brush () const [inline] Return Brush. QwtSymbol * QwtSymbol::clone () const [virtual] Allocate and return a symbol with the same attributes Returns: Cloned symbol void QwtSymbol::draw (QPainter *painter, const QRect &r) const [virtual] Draw the symbol into a bounding rectangle. This function assumes that the painter has been initialized with brush and pen before. This allows a much more performant implementation when painting many symbols with the same brush and pen like in curves. Parameters: painter Painter r Bounding rectangle void QwtSymbol::draw (QPainter *painter, const QPoint &pos) const Draw the symbol at a specified point. Parameters: painter Painter pos Center of the symbol void QwtSymbol::draw (QPainter *p, intx, inty) const Draw the symbol at a point (x,y). bool QwtSymbol::operator!= (const QwtSymbol &other) const != operator bool QwtSymbol::operator== (const QwtSymbol &other) const [virtual] == operator const QPen& QwtSymbol::pen () const [inline] Return Pen. void QwtSymbol::setBrush (const QBrush &brush) Assign a brush. The brush is used to draw the interior of the symbol. Parameters: brush Brush void QwtSymbol::setPen (const QPen &pen) Assign a pen The pen is used to draw the symbol's outline. The width of non cosmetic pens is scaled according to the resolution of the paint device. Parameters: pen Pen See also: pen(), setBrush(), QwtPainter::scaledPen() void QwtSymbol::setSize (const QSize &size) Set the symbol's size Parameters: size Size void QwtSymbol::setSize (intwidth, intheight = -1) Specify the symbol's size. If the 'h' parameter is left out or less than 0, and the 'w' parameter is greater than or equal to 0, the symbol size will be set to (w,w). Parameters: width Width height Height (defaults to -1) void QwtSymbol::setStyle (QwtSymbol::Styles) Specify the symbol style. The following styles are defined: NoSymbol No Style. The symbol cannot be drawn. Ellipse Ellipse or circle Rect Rectangle Diamond Diamond Triangle Triangle pointing upwards DTriangle Triangle pointing downwards UTriangle Triangle pointing upwards LTriangle Triangle pointing left RTriangle Triangle pointing right Cross Cross (+) XCross Diagonal cross (X) HLine Horizontal line VLine Vertical line Star1 X combined with + Star2 Six-pointed star Hexagon Hexagon Parameters: s style const QSize& QwtSymbol::size () const [inline] Return Size. Style QwtSymbol::style () const [inline] Return Style. Author Generated automatically by Doxygen for Qwt User's Guide from the source code. Version 5.2.2 Mon Aug 1 2011 QwtSymbol(3)
All times are GMT -4. The time now is 10:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy