Sponsored Content
Full Discussion: compare null with non-null
Top Forums Shell Programming and Scripting compare null with non-null Post 302094998 by nitin on Thursday 2nd of November 2006 12:48:14 PM
Old 11-02-2006
Here is a sample data:

"","","SGP0000","Yes","Support","100006;","","charters","","Charters","xxx@xx.com","","9/29/2006 10:00:37 AM","9/29/2006 10:07:36 AM","10/24/2006 8:14:18 AM","Charters"

I've truncated most of the fields. So, there are some fields which may have time and date stamps etc. Lets compare the first field, it is null. Well it has "" that but for database standpoint it is null. I guess I could strip that using vi and really make it a null. The other file may have some thing like this:

"Charter group","","SGP0000","Yes","Support","100006;","","charters","","Charters","xxx@xx.com","","10/30/2006 10:00:26 AM","10/31/2006 10:11:45 AM","10/29/2006 9:18:21 AM","Charters"

So I would like to report that the first field has a diff. However, in field 13, 14, time stamps are different, I don't want that to be reported. The problem is that I can't always tell where these time fields will be. That usually depends on the DBA and developer, how they out put the data.


Thanks,
Nitin

Last edited by nitin; 11-02-2006 at 03:10 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Null Value

Hello All, I have a file of the format **** 123 abc ABC 456 bcd BCD 789 def 112 ghi GHI 223 jkl 344 mno MNO **** I am trying to extract the lines that have no values in the third field (in this case, this would be 789 def 223 jkl Can anyone please help??... (1 Reply)
Discussion started by: Khoomfire
1 Replies

2. Shell Programming and Scripting

> /dev/null

hello all, In many shell scripts i found '> /dev/null' , i am not able to get this, will any one please explain why we are using this. thanks sudha (2 Replies)
Discussion started by: rrs
2 Replies

3. UNIX for Dummies Questions & Answers

How to compare null and space using single if condition

Hi I have a input file with many fields and each filed will be with in double quotes(""). i want to check fields contains balnk,null or space using condition using if. when i write code as below for if condition its not working a=`awk -F ',' '{gsub("\"", "", $1);'NF==0';printf $1}'... (3 Replies)
Discussion started by: jayakumarrt
3 Replies

4. Shell Programming and Scripting

/dev/null

Hi expert, May I know what is the difference between below cron tab entry ? 0,12 * * * * /abc/myscript.sh > /dev/null 2>&1 0,12 * * * * /abc/myscript.sh (7 Replies)
Discussion started by: olaris
7 Replies

5. Shell Programming and Scripting

/dev/null what is the use of it?

when do you use the path /dev/null (3 Replies)
Discussion started by: webmunkey23
3 Replies

6. 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

7. Shell Programming and Scripting

Insert string 'NULL' where there is a null value

I have an input file having 7 fields delimited by , eg : 1,ABC,hg,1,2,34,3 2,hj,YU,2,3,4, 3,JU,kl,4,5,7, 4,JK,KJ,3,56,4,5 The seventh field here in some lines is empty, whereas the other lines there is a value. How do I insert string NULL at this location (7th loc) for these lines where... (8 Replies)
Discussion started by: zilch
8 Replies

8. UNIX for Dummies Questions & Answers

/dev/null 2>&1 Versus /dev/null 2>1

How are these two different? They both prevent output and error from being displayed. I don't see the use of the "&" echo "hello" > /dev/null 2>&1 echo "hello" > /dev/null 2>1 (3 Replies)
Discussion started by: glev2005
3 Replies

9. Shell Programming and Scripting

Check for null

Hi Champs!!! im a newbie in unix, need ur expert help for my problem... I need to search if there are any "NULL" entries in the string String without Null Str1: 203652|1000003653|tellt|RUPV|4649|1|07/28/2011 01:56:12 String with Null (RUPV is removed) Str2:... (5 Replies)
Discussion started by: guruprasad7
5 Replies

10. Shell Programming and Scripting

Redirecting standard out to /dev/null goes to file "/dev/null" instead

I apologize if this question has been answered else where or is too elementary. I ran across a KSH script (long unimportant story) that does this: if ; then CAS_SRC_LOG="/var/log/cas_src.log 2>&1" else CAS_SRC_LOG="/dev/null 2>&1" fithen does this: /usr/bin/echo "heartbeat:... (5 Replies)
Discussion started by: jbmorrisonjr
5 Replies
ZZIP_ENTRY_FINDFILE(3)					       zziplib Function List					    ZZIP_ENTRY_FINDFILE(3)

NAME
zzip_entry_findfile, zzip_entry_findfirst, zzip_entry_findnext, zzip_entry_free, zzip_entry_findmatch - search for files in the (fseeko) zip central directory SYNOPSIS
#include <zzip/fseeko.h> zzip__new__ ZZIP_ENTRY * zzip_entry_findfile((FILE * disk, char *filename, ZZIP_ENTRY * _zzip_restrict entry, zzip_strcmp_fn_t compare)); zzip__new__ ZZIP_ENTRY * zzip_entry_findfirst((FILE * disk)); zzip__new__ ZZIP_ENTRY * zzip_entry_findnext((ZZIP_ENTRY * _zzip_restrict entry)); int zzip_entry_free((ZZIP_ENTRY * entry)); zzip__new__ ZZIP_ENTRY * zzip_entry_findmatch((FILE * disk, char *filespec, ZZIP_ENTRY * _zzip_restrict entry, zzip_fnmatch_fn_t compare, int flags)); DESCRIPTION
The zzip_entry_findfile function is given a filename as an additional argument, to find the disk_entry matching a given filename. The compare-function is usually strcmp or strcasecmp or perhaps strcoll, if null then strcmp is used. - use null as argument for "old"-entry when searching the first matching entry, otherwise the last returned value if you look for other entries with a special "compare" function (if null then a doubled search is rather useless with this variant of _findfile). If no further entry is found then null is returned and any "old"-entry gets already free()d. The zzip_entry_findfirst function is the first call of all the zip access functions here. It contains the code to find the first entry of the zip central directory. Here we require the stdio handle to represent a real zip file where the disk_trailer is _last_ in the file area, so that its position would be at a fixed offset from the end of the file area if not for the comment field allowed to be of variable length (which needs us to do a little search for the disk_tailer). However, in this simple implementation we disregard any disk_trailer info telling about multidisk archives, so we just return a pointer to the first entry in the zip central directory of that file. For an actual means, we are going to search backwards from the end of the mmaped block looking for the PK-magic signature of a disk_trailer. If we see one then we check the rootseek value to find the first disk_entry of the root central directory. If we find the correct PK-magic signature of a disk_entry over there then we assume we are done and we are going to return a pointer to that label. The return value is a pointer to the first zzip_disk_entry being checked to be within the bounds of the file area specified by the arguments. If no disk_trailer was found then null is returned, and likewise we only accept a disk_trailer with a seekvalue that points to a disk_entry and both parts have valid PK-magic parts. Beyond some sanity check we try to catch a common brokeness with zip archives that still allows us to find the start of the zip central directory. The zzip_entry_findnext function takes an existing "entry" in the central root directory (e.g. from zzip_entry_findfirst) and moves it to point to the next entry. On error it returns 0, otherwise the old entry. If no further match is found then null is returned and the entry already free()d. If you want to stop searching for matches before that case then please call zzip_entry_free on the cursor struct ZZIP_ENTRY. the zzip_entry_free function releases the malloc()ed areas needed for zzip_entry, the pointer is invalid afterwards. The zzip_entry_free function has #define synonyms of zzip_entry_findlast(), zzip_entry_findlastfile(), zzip_entry_findlastmatch() The zzip_entry_findmatch function uses a compare-function with an additional argument and it is called just like fnmatch(3) from POSIX.2 AD:1993), i.e. the argument filespec first and the ziplocal filename second with the integer-flags put in as third to the indirect call. If the platform has fnmatch available then null-compare will use that one and otherwise we fall back to mere strcmp, so if you need fnmatch searching then please provide an implementation somewhere else. - use null as argument for "after"-entry when searching the first matching entry, or the last disk_entry return-value to find the next entry matching the given filespec. If no further entry is found then null is returned and any "old"-entry gets already free()d. AUTHOR
o Guido Draheim <guidod@gmx.de> COPYRIGHT
Copyright (c) 2003,2004 Guido Draheim All rights reserved, use under the restrictions of the Lesser GNU General Public License or alternatively the restrictions of the Mozilla Public License 1.1 zziplib 0.13.62 ZZIP_ENTRY_FINDFILE(3)
All times are GMT -4. The time now is 04:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy