Sponsored Content
Full Discussion: Handle null values-awk
Top Forums Shell Programming and Scripting Handle null values-awk Post 302829707 by RudiC on Friday 5th of July 2013 04:29:01 PM
Old 07-05-2013
Try to or in the empty string into the regex:
Code:
       $5 !~ /^$|^[0-9]...
                ^--- regex OR sign
              ^^--- empty string

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

comparing the null values in the unix

hi all, iam new to this forum.i have to submit the script EOD.so please help me. my requirement is to compare two null values..iam trying to compare two null values :One null value output of the storedprocedure and another iam giving spaces in script. it is giving the error... (11 Replies)
Discussion started by: bbc17484
11 Replies

2. UNIX for Dummies Questions & Answers

Check for null values in a column

Hi All, I have a file with 10 columns and get the required data for nine columns properly except 8th. In 8th column i have both NULL and NON NULL values...i.e certain records have values for all the columns including 8th column and certain records have 8th column as NULL.My requisite is,without... (20 Replies)
Discussion started by: ganesh_248
20 Replies

3. UNIX for Advanced & Expert Users

How to Compare Null values??

Hi, Can someone help me comparing Null values. Scenario is as follows: I have a variable which "cache_prd" which can have either some integer or nothing(Null) if it is integer I have to again do some comparision but these comparisons give me this error:( "line 32: [: 95: unary operator... (3 Replies)
Discussion started by: Yagami
3 Replies

4. Shell Programming and Scripting

sorting null values

Hi I have a file with the values abc res set kls lmn ops i want to sort this file with the null values at the bottom of the file OUTPUT should look like this abc kls lmn ops (6 Replies)
Discussion started by: vickyhere
6 Replies

5. Shell Programming and Scripting

How to use sort with null values?

Hello everyone I am doing a join command. Obviously, before I need two files sorted first. ( Both files have headers and have about 2 million lines each one ) The problem is, one of the files has null values in the key to sort (which is the first filed ). For example I have the original... (4 Replies)
Discussion started by: viktor1985
4 Replies

6. Shell Programming and Scripting

How to handle NULL value output from ISQL command?

I am using ISQL command in ksh script. Suppose if i get NULL value from the query which i run,how can i handle it? I am getting a NULL result set and the following error is coming. ############### output of isql command for getting the sum of JEs ################ ----------- NULL... (4 Replies)
Discussion started by: Sharma331
4 Replies

7. Shell Programming and Scripting

Replace null values in csv with zero

Hi, i have another issue: i have three files: FILE 1 ServiceEventHandler, Processed,Percentage 5285337,100% FILE 2 Wallet, Processed,Percentage 5285337,100% (1 Reply)
Discussion started by: reignangel2003
1 Replies

8. Shell Programming and Scripting

Replace null values with dot using awk

Using awk I am trying to replace all blank or null values with a . in the tad delimited input. I hope the awk is close. Thank you :). input name test sam 1 liz 2 al 1 awk awk 'BEGIN{FS=OFS="\t"}{for(i=1;++i<NF;)$i=$i?$i:"."}1'input awk 'BEGIN { FS =... (6 Replies)
Discussion started by: cmccabe
6 Replies

9. Shell Programming and Scripting

Printing null values in awk

Hi, I have a csv file with given details abc.txt 123,ra,point,,there 232,ba,points,home,pheer I want to get those values and store them in different variables: Code: while read line do echo $line |awk -F"," '{print $1" "$2" "$3" "$4" "$5"}'|read dbt_acct val_dt crncy AMT... (11 Replies)
Discussion started by: rahulsk
11 Replies

10. Shell Programming and Scripting

Count null values in a file using awk

I have the following a.txt file A|1|2|3|4|5| A||2|3|0|| A|1|6||8|10| A|9|2|3|4|1| A|0|9|3|4|5| A||2|3|4|5| A|0|av|.9|4|9| I use the following command to count null values for 2nd field awk -F"|" '!$2 { N++; next } END {print N}' a.txt It should give the result 2, but it is giving... (2 Replies)
Discussion started by: RJG
2 Replies
RE_COMP(3)						     Linux Programmer's Manual							RE_COMP(3)

NAME
re_comp, re_exec - BSD regex functions SYNOPSIS
#define _REGEX_RE_COMP #include <sys/types.h> #include <regex.h> char *re_comp(char *regex); int re_exec(char *string); DESCRIPTION
re_comp() is used to compile the null-terminated regular expression pointed to by regex. The compiled pattern occupies a static area, the pattern buffer, which is overwritten by subsequent use of re_comp(). If regex is NULL, no operation is performed and the pattern buffer's contents are not altered. re_exec() is used to assess whether the null-terminated string pointed to by string matches the previously compiled regex. RETURN VALUE
re_comp() returns NULL on successful compilation of regex otherwise it returns a pointer to an appropriate error message. re_exec() returns 1 for a successful match, zero for failure. CONFORMING TO
4.3BSD. NOTES
These functions are obsolete; the functions documented in regcomp(3) should be used instead. SEE ALSO
regcomp(3), regex(7), GNU regex manual COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. GNU
1995-07-14 RE_COMP(3)
All times are GMT -4. The time now is 12:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy