Sponsored Content
Top Forums Shell Programming and Scripting Check input file with different criteria Post 302733127 by jim mcnamara on Monday 19th of November 2012 09:30:09 PM
Old 11-19-2012
Code:
awk ' BEGIN{print "Script have error in Below Line" ; bad=0}
       { ok=0
          ok=(NF==3)?1:0
          if(ok)   {ok=($(NF)==0 || ($(NF)<=100 && $(NF)>=10)?1:0}
          if(!ok} {print $0; bad++}
          next;
        }
          END 
         {print (bad==0) ? "no errors found" : 
                         "Please verify your input and run the script again " } ' inputfile

Try that
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

check presence of input file

My script is taking a file "input.in" as input for running the script. My worry is that i need to execute the script only if the file is present, if it's not don't perform the next commands. Just to have a check at the beginning of the script : If "input.in" exists, then go on. If it's does not... (4 Replies)
Discussion started by: newpromo
4 Replies

2. Shell Programming and Scripting

Need to find a string, check the next line, and if it matches certain criteria, replace it with a s

Hey Fellas. I am new to scripting. I have searched through the forums and found a lot of good info, but I can't seem to get any of it to work together. I am trying to find a particular sting in a file, and if the next string matches certain criteria, replace it with a string from a csv... (6 Replies)
Discussion started by: midniteslice
6 Replies

3. Shell Programming and Scripting

How to check field formatting of input file?

Hi, I had input file with below data, abcdefghij;20100903040607;1234567891;GLOBAL; Having values of fields with seperated by semi-colon (;) and ended with line feed (\n). Through shell script, how can I check the field formatting? Thanks in advance. (18 Replies)
Discussion started by: Poonamol
18 Replies

4. Shell Programming and Scripting

shell script to take input from a text file and perform check on each servers and copy files

HI all, I want to script where all the server names will be in a text file like server1 server2 server3 . and the script should take servernames from a text file and perform copy of files if the files are not present on those servers.after which it should take next servername till the end of... (0 Replies)
Discussion started by: joseph.dmello
0 Replies

5. Shell Programming and Scripting

Input file check

Hi, I have a script which runs daily. It gets 3 input files test1,test2,test3. I want to do a validation in my script to make sure i have all the 3 files available before running. If any one of the file is missing i want to break the script. Could you please help me with this request. ... (1 Reply)
Discussion started by: Krrishv
1 Replies

6. Shell Programming and Scripting

Check if file is present using input from another file

Hello, I have a comma delimited file such as: cat /statistics/support/input.txt ID,Serial,quantitity,atribute1,atribute2 1,89569698,5,800,9900, 1,35568658,8,1200,5550 1,89569698,8,320,5500 1,68753584,85,450,200 ID should always have 1 digit, Serial 8 digits, and the others may... (2 Replies)
Discussion started by: alex2005
2 Replies

7. Shell Programming and Scripting

Input file is uncolored; I want the output file to be colored on criteria

Hello, I have the following input file: auditing account: 3DTP (3dtp) ERROR: S3 bucket "aws-origin-test1.3dstage.com" has policy statement with public grant: {"Sid":"PublicReadGetObject","Effect":"Allow","Principal":{"AWS":"*"},"Action":,"Resource":} auditing region: eu-west-1 auditing... (5 Replies)
Discussion started by: ramky79
5 Replies

8. Shell Programming and Scripting

Check if 2 input values exists in a file

I have a file number.txt.I need to get 2 inputs from the terminal like a=100 and b=200.If a and b are there in the file,then check if a < b,print "less".If a is not there in the file,print "a is missing" or if b is not there in the file,print "b is missing". number.txt: 100 200 300 (2 Replies)
Discussion started by: aneeta13
2 Replies

9. UNIX for Beginners Questions & Answers

Remove lines from File.A based on criteria in File.B

Hello, I have two files of the following form. I would like to remove from File.A where the first three colum matches values in File.B to give the output in File.C File.A 121 54321 PQR CAT 122 765431 ABC DOG 124 98765 ZXY TIGER 125 86432 GEF LION File.B 122 765431 ABC 125 86432 GEF... (4 Replies)
Discussion started by: Gussifinknottle
4 Replies

10. UNIX for Beginners Questions & Answers

Insert content from file 1 to file 2 in specific criteria meet

Hi , I'm looking for some code that can copy and paste form file1 to file2 with 2 criterial meet. file1: test "sp-j1" test "sp-j2" test "sp-j3" test "sp-j4" file2: sub Pre_Shorts1 (Status_Code, Message$) global Status !if Message$ <> "" then print... (3 Replies)
Discussion started by: kttan
3 Replies
GAMMA(3)						User Contributed Perl Documentation						  GAMMA(3)

NAME
PDL::GSLSF::GAMMA - PDL interface to GSL Special Functions DESCRIPTION
This is an interface to the Special Function package present in the GNU Scientific Library. SYNOPSIS
Functions FUNCTIONS
gsl_sf_lngamma Signature: (double x(); double [o]y(); double [o]s(); double [o]e()) Log[Gamma(x)], x not a negative integer Uses real Lanczos method. Determines the sign of Gamma[x] as well as Log[|Gamma[x]|] for x < 0. So Gamma[x] = sgn * Exp[result_lg]. gsl_sf_lngamma does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_gamma Signature: (double x(); double [o]y(); double [o]e()) Gamma(x), x not a negative integer gsl_sf_gamma does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_gammastar Signature: (double x(); double [o]y(); double [o]e()) Regulated Gamma Function, x > 0 Gamma^*(x) = Gamma(x)/(Sqrt[2Pi] x^(x-1/2) exp(-x)) = (1 + 1/(12x) + ...), x->Inf gsl_sf_gammastar does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_gammainv Signature: (double x(); double [o]y(); double [o]e()) 1/Gamma(x) gsl_sf_gammainv does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_lngamma_complex Signature: (double zr(); double zi(); double [o]x(); double [o]y(); double [o]xe(); double [o]ye()) Log[Gamma(z)] for z complex, z not a negative integer. Calculates: lnr = log|Gamma(z)|, arg = arg(Gamma(z)) in (-Pi, Pi] gsl_sf_lngamma_complex does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_taylorcoeff Signature: (double x(); double [o]y(); double [o]e(); int n) x^n / n! gsl_sf_taylorcoeff does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_fact Signature: (x(); double [o]y(); double [o]e()) n! gsl_sf_fact does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_doublefact Signature: (x(); double [o]y(); double [o]e()) n!! = n(n-2)(n-4) gsl_sf_doublefact does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_lnfact Signature: (x(); double [o]y(); double [o]e()) ln n! gsl_sf_lnfact does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_lndoublefact Signature: (x(); double [o]y(); double [o]e()) ln n!! gsl_sf_lndoublefact does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_lnchoose Signature: (n(); m(); double [o]y(); double [o]e()) log(n choose m) gsl_sf_lnchoose does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_choose Signature: (n(); m(); double [o]y(); double [o]e()) n choose m gsl_sf_choose does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_lnpoch Signature: (double x(); double [o]y(); double [o]s(); double [o]e(); double a) Logarithm of Pochammer (Apell) symbol, with sign information. result = log( |(a)_x| ), sgn = sgn( (a)_x ) where (a)_x := Gamma[a + x]/Gamma[a] gsl_sf_lnpoch does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_poch Signature: (double x(); double [o]y(); double [o]e(); double a) Pochammer (Apell) symbol (a)_x := Gamma[a + x]/Gamma[x] gsl_sf_poch does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_pochrel Signature: (double x(); double [o]y(); double [o]e(); double a) Relative Pochammer (Apell) symbol ((a,x) - 1)/x where (a,x) = (a)_x := Gamma[a + x]/Gamma[a] gsl_sf_pochrel does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_gamma_inc_Q Signature: (double x(); double [o]y(); double [o]e(); double a) Normalized Incomplete Gamma Function Q(a,x) = 1/Gamma(a) Integral[ t^(a-1) e^(-t), {t,x,Infinity} ] gsl_sf_gamma_inc_Q does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_gamma_inc_P Signature: (double x(); double [o]y(); double [o]e(); double a) Complementary Normalized Incomplete Gamma Function P(a,x) = 1/Gamma(a) Integral[ t^(a-1) e^(-t), {t,0,x} ] gsl_sf_gamma_inc_P does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_lnbeta Signature: (double a(); double b(); double [o]y(); double [o]e()) Logarithm of Beta Function Log[B(a,b)] gsl_sf_lnbeta does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. gsl_sf_beta Signature: (double a(); double b();double [o]y(); double [o]e()) Beta Function B(a,b) gsl_sf_beta does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. AUTHOR
This file copyright (C) 1999 Christian Pellegrin <chri@infis.univ.trieste.it> All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. The GSL SF modules were written by G. Jungman. perl v5.12.1 2010-07-05 GAMMA(3)
All times are GMT -4. The time now is 06:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy