Sponsored Content
Top Forums Shell Programming and Scripting search file for value greater than 'n' on each line and email Post 302642031 by agama on Wednesday 16th of May 2012 11:42:20 PM
Old 05-17-2012
Using ksh or bash, something like this, provided you want to alarm if any line in the file exceeds the threshold.

Code:
if ! awk -F , -v threshold=60.0 '$7+0 > threshold { exit( 1 ) }' <input-file
then
    echo "alert!"
fi


Last edited by agama; 05-17-2012 at 12:43 AM.. Reason: left testing value in -- removed
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl search and replace - search in first line and replance in 2nd line

Dear All, i want to search particular string and want to replance next line value. following is the test file. search string is tmp,??? ,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50 tmp,123 --- if match tmp,??? then... (3 Replies)
Discussion started by: arvindng
3 Replies

2. UNIX for Dummies Questions & Answers

need a command to search for numbers greater than 3000

i have a file contains: 13213,A,300 3423,C,200 5563,A,201 3000,A,400 3000,A,402 3000,A,206 3000,A,303 3000,A,200 4233,N,204 i need to search for numbers in the first column are greater than 3000? i have another issue if you can help me? if i want to search in the second or the... (7 Replies)
Discussion started by: takyeldin
7 Replies

3. Shell Programming and Scripting

search column and delete row if greater than value

Hi, as the title states i need to find a way to search a column for values great than 1000, and if it is, then delete that row. An example 1 7.021 6.967 116.019 4 U 6.980E+07 0.000E+00 e 0 0 0 0 2 8.292 7.908 118.063 3 U 1.440E+07 0.000E+00 e 0 821 814 ... (3 Replies)
Discussion started by: olifu02
3 Replies

4. Shell Programming and Scripting

search a string in a particular column of file and return the line number of the line

Hi All, Can you please guide me to search a string in a particular column of file and return the line number of the line where it was found using awk. As an example : abc.txt 7000,john,2,1,0,1,6 7001,elen,2,2,0,1,7 7002,sami,2,3,0,1,6 7003,mike,1,4,0,2,1 8001,nike,1,5,0,1,8... (3 Replies)
Discussion started by: arunshankar.c
3 Replies

5. Shell Programming and Scripting

PERL or SHELL Scrript to search in Directories by taking line by line from a text file

Unix box server version *********** >uname -r B.11.00 >echo $SHELL /usr/bin/ksh --> in this server, I have the path like /IMbuild/dev/im0serv1 ---> in that directory I have the folders startup(.jsp files nearly 100 jsp's ) and scripts(contains .js files nearly 100 files) ... (9 Replies)
Discussion started by: pasam
9 Replies

6. Shell Programming and Scripting

compare files and remove a line from a file if first column is greater than 25

my files are as follows fileA sepearated by tab /t 00 lieferungen 00 attractiop 01 done 02 forness 03 rasp 04 alwaysisng 04 funny 05 done1 fileB funnymou120112 funnymou234470 mou3raspnhdhv rddfgmoudone1438748 so all those record which are greater than 3 and which are not... (4 Replies)
Discussion started by: rajniman
4 Replies

7. Shell Programming and Scripting

How to search for numbers greater than x?

I have a file with multiple fields, example below File 1: Field 1|Field 2|Field 3|Field 4|Field 5|Field 6|Field 7|100 Field 1|Field 2|Field 3|Field 4|Field 5|Field 6|Field 7|101 Field 1|Field 2|Field 3|Field 4|Field 5|Field 6|Field 7|102 Field 1|Field 2|Field 3|Field 4|Field 5|Field... (4 Replies)
Discussion started by: castrojc
4 Replies

8. Shell Programming and Scripting

Search string within a file and list common words from the line having the search string

Hi, Need your help for this scripting issue I have. I am not really good at this, so seeking your help. I have a file looking similar to this: Hello, i am human and name=ABCD. How are you? Hello, i am human and name=PQRS. I am good. Hello, i am human and name=ABCD. Good bye. Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies

9. Shell Programming and Scripting

Search words in multiple file line by line

Hi All I have to search servers name say like 1000+ "unique names" line by line in child.txt files in another file that is a master file where all server present say "master.txt",if child.txt's server name matches with master files then it print yes else no with server name. (4 Replies)
Discussion started by: netdbaind
4 Replies

10. UNIX for Advanced & Expert Users

Search for columns with numbers greater than 70

This helped get me started. https://www.unix.com/unix-for-dummies-questions-and-answers/157026-need-command-search-numbers-greater-than-3000-a.html This is the command I am using. I am trying to find numbers greater than 70 in column 5. I do not know if it is getting confused because there... (6 Replies)
Discussion started by: cokedude
6 Replies
XChangePointerControl(3X11)					     MIT X11R4					       XChangePointerControl(3X11)

Name
       XChangePointerControl, XGetPointerControl - control pointer

Syntax
       XChangePointerControl(display, do_accel, do_threshold, accel_numerator, accel_denominator, threshold)
	  Display *display;
	  Bool do_accel, do_threshold;
	  int accel_numerator, accel_denominator;
	  int threshold;

       XGetPointerControl(display, accel_numerator_return, accel_denominator_return, threshold_return)
	  Display *display;
	  int *accel_numerator_return, *accel_denominator_return;
	  int *threshold_return;

Arguments
       accel_denominator
		 Specifies the denominator for the acceleration multiplier.

       accel_denominator_return
		 Returns the denominator for the acceleration multiplier.

       accel_numerator
		 Specifies the numerator for the acceleration multiplier.

       accel_numerator_return
		 Returns the numerator for the acceleration multiplier.

       display	 Specifies the connection to the X server.

       do_accel  Specifies a Boolean value that controls whether the values for the accel_numerator or accel_denominator are used.

       do_threshold
		 Specifies a Boolean value that controls whether the value for the threshold is used.

       threshold Specifies the acceleration threshold.

       threshold_return
		 Returns the acceleration threshold.

Description
       The function defines how the pointing device moves.  The acceleration, expressed as a fraction, is a multiplier for movement.  For example,
       specifying 3/1 means the pointer moves three times as fast as normal.  The fraction may be rounded arbitrarily by the X server.	Accelera-
       tion only takes effect if the pointer moves more than threshold pixels at once and only applies to the amount beyond the value in the
       threshold argument.  Setting a value to -1 restores the default.  The values of the do_accel and do_threshold arguments must be for the
       pointer values to be set, or the parameters are unchanged.  Negative values (other than -1) generate a error, as does a zero value for the
       accel_denominator argument.

       can generate a error.

       The function returns the pointer's current acceleration multiplier and acceleration threshold.

Diagnostics
       Some numeric value falls outside the range of values accepted by the request.
		 Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument
		 defined as a set of alternatives can generate this error.

See Also
       X Window System: The Complete Reference, Second Edition, Robert W. Scheifler and James Gettys

														       XChangePointerControl(3X11)
All times are GMT -4. The time now is 01:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy