Sponsored Content
Homework and Emergencies Homework & Coursework Questions Shell Script: Sorting by column using grep/awk Post 302781209 by DGPickett on Friday 15th of March 2013 05:23:00 PM
Old 03-15-2013
You can substring with decimals, too: -k 1.3,1.9
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

grep, awk, typeset in a shell script..

For e.g I have a file named "relation" which has three coloums i.e JOHN MARY JACK PETE ALISIA JONNY TONY JACKIE VICTOR If I do grep -w 'JOHN' relation | awk '{print""$1" is husband of "$2" & father of "$3""}' It gives out JOHN i husband of MARY & father of JACK (which is desired... (7 Replies)
Discussion started by: nick_25
7 Replies

2. Shell Programming and Scripting

Shell script / Grep / Awk to variable and Loop

Hi, I have a text file with data in that I wish to extract, assign to a variable and process through a loop. Kind of the process that I am after: 1: Grep the text file for the values. Currently using: cat /root/test.txt | grep TESTING= | awk -F"=" '{ a = $2 } {print a}' | sort -u ... (0 Replies)
Discussion started by: Spoonless
0 Replies

3. Shell Programming and Scripting

AWK/GREP sorting help

hi everyone, I am kind of new to this forum. I need help in sorting this data out accordingly, I am actually doing a traceroute application and wants my AS path displayed in front of my address like this; 192.168.1.1 AS28513 AS65534 AS5089 AS5089 .... till the last AS number and if possible sort... (8 Replies)
Discussion started by: sam127
8 Replies

4. Shell Programming and Scripting

grep/awk column or variable?

Hi, I'm running via PuTTY, in a BASH shell to do my work. I'm running calculations where steps are reported like this every 100 steps: NSTEP = 249900 TIME(PS) = 249.900 TEMP(K) = 299.94 PRESS = 21.1 Etot = -12912.5557 EKtot = 4996.8780 EPtot = -17909.4336 ... (6 Replies)
Discussion started by: Oriksagtaria
6 Replies

5. Shell Programming and Scripting

AWK script to create max value of 3rd column, grouping by first column

Hi, I need an awk script (or whatever shell-construct) that would take data like below and get the max value of 3 column, when grouping by the 1st column. clientname,day-of-month,max-users ----------------------------------- client1,20120610,5 client2,20120610,2 client3,20120610,7... (3 Replies)
Discussion started by: ckmehta
3 Replies

6. UNIX for Dummies Questions & Answers

Problem with sorting in shell script

Hi, I have the following list: 42A 42AA 42B 42BB 42AAA 42BBB 49A 49AA 49B 49AAA 49BB I need it to be sorted as following: 42A 42B (2 Replies)
Discussion started by: sairamtejaswi
2 Replies

7. Shell Programming and Scripting

Grep/awk part of info of a column

I have a question that I am at a loss to solve. I have 3 column tab-separated data, such as: abs nmod+n+n-commitment-n 349.200023 abs nmod+n+n-a-commitment-n 333.306429 abs into+ns-j+vn-pass-rb-divide-v 295.57316 abs nmod+n+ns-commitment-n 182.085018 abs nmod+n+n-pledge-n ... (2 Replies)
Discussion started by: owwow14
2 Replies

8. Shell Programming and Scripting

How to awk or grep the last column in file when date on column contains spaces?

Hi have a large spreadsheet which has 4 columns APM00111803814 server_2 96085 Corp IT Desktop and Apps APM00111803814 server_2 96085 Corp IT Desktop and Apps APM00111803814 server_2 96034 Storage Mgmt Team APM00111803814 server_2 96152 GWP... (6 Replies)
Discussion started by: kieranfoley
6 Replies

9. Shell Programming and Scripting

awk script to append suffix to column when column has duplicated values

Please help me to get required output for both scenario 1 and scenario 2 and need separate code for both scenario 1 and scenario 2 Scenario 1 i need to do below changes only when column1 is CR and column3 has duplicates rows/values. This inputfile can contain 100 of this duplicated rows of... (1 Reply)
Discussion started by: as7951
1 Replies

10. Shell Programming and Scripting

Need awk or Shell script to compare Column-1 of two different CSV files and print if column-1 matche

Example: I have files in below format file 1: zxc,133,joe@example.com cst,222,xyz@example1.com File 2 Contains: hxd hcd jws zxc cst File 1 has 50000 lines and file 2 has around 30000 lines : Expected Output has to be : hxd hcd jws (5 Replies)
Discussion started by: TestPractice
5 Replies
QDoubleValidator(3qt)													     QDoubleValidator(3qt)

NAME
QDoubleValidator - Range checking of floating-point numbers SYNOPSIS
#include <qvalidator.h> Inherits QValidator. Public Members QDoubleValidator ( QObject * parent, const char * name = 0 ) QDoubleValidator ( double bottom, double top, int decimals, QObject * parent, const char * name = 0 ) ~QDoubleValidator () virtual QValidator::State validate ( QString & input, int & ) const virtual void setRange ( double minimum, double maximum, int decimals = 0 ) void setBottom ( double ) void setTop ( double ) void setDecimals ( int ) double bottom () const double top () const int decimals () const Properties double bottom - the validator's minimum acceptable value int decimals - the validator's maximum number of digits after the decimal point double top - the validator's maximum acceptable value DESCRIPTION
The QDoubleValidator class provides range checking of floating-point numbers. QDoubleValidator provides an upper bound, a lower bound and a limit on the number of digits after the decimal point. It does not provide a fixup() function. You can set the acceptable range in one call with setRange(), or with setBottom() and setTop(). Set the number of decimal places with setDecimals(). The validate() function returns the validation state. See also QIntValidator, QRegExpValidator, and Miscellaneous Classes. MEMBER FUNCTION DOCUMENTATION
QDoubleValidator::QDoubleValidator ( QObject * parent, const char * name = 0 ) Constructs a validator object with parent parent, called name, which accepts any double. QDoubleValidator::QDoubleValidator ( double bottom, double top, int decimals, QObject * parent, const char * name = 0 ) Constructs a validator object with parent parent, called name. This validator will accept doubles from bottom to top inclusive, with up to decimals digits after the decimal point. QDoubleValidator::~QDoubleValidator () Destroys the validator, freeing any resources used. double QDoubleValidator::bottom () const Returns the validator's minimum acceptable value. See the "bottom" property for details. int QDoubleValidator::decimals () const Returns the validator's maximum number of digits after the decimal point. See the "decimals" property for details. void QDoubleValidator::setBottom ( double ) Sets the validator's minimum acceptable value. See the "bottom" property for details. void QDoubleValidator::setDecimals ( int ) Sets the validator's maximum number of digits after the decimal point. See the "decimals" property for details. void QDoubleValidator::setRange ( double minimum, double maximum, int decimals = 0 ) [virtual] Sets the validator to accept doubles from minimum to maximum inclusive, with at most decimals digits after the decimal point. void QDoubleValidator::setTop ( double ) Sets the validator's maximum acceptable value. See the "top" property for details. double QDoubleValidator::top () const Returns the validator's maximum acceptable value. See the "top" property for details. QValidator::State QDoubleValidator::validate ( QString & input, int & ) const [virtual] Returns Acceptable if the string input contains a double that is within the valid range and is in the correct format. Returns Intermediate if input contains a double that is outside the range or is in the wrong format, e.g. with too many digits after the decimal point or is empty. Returns Invalid if the input is not a double. Reimplemented from QValidator. Property Documentation double bottom This property holds the validator's minimum acceptable value. Set this property's value with setBottom() and get this property's value with bottom(). See also setRange(). int decimals This property holds the validator's maximum number of digits after the decimal point. Set this property's value with setDecimals() and get this property's value with decimals(). See also setRange(). double top This property holds the validator's maximum acceptable value. Set this property's value with setTop() and get this property's value with top(). See also setRange(). SEE ALSO
http://doc.trolltech.com/qdoublevalidator.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2001 Trolltech AS, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qdoublevalidator.3qt) and the Qt version (3.1.1). Trolltech AS 9 December 2002 QDoubleValidator(3qt)
All times are GMT -4. The time now is 09:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy