Sponsored Content
Full Discussion: Find null fields in file
Top Forums Shell Programming and Scripting Find null fields in file Post 302077451 by rahulrathod on Thursday 22nd of June 2006 09:11:23 AM
Old 06-22-2006
Find null fields in file

Hi All,

I have some csv files out of which i want to find records which have empty values in either the 14th or 16th fields.

The following is a sample.

$cut -d',' -f14,16 SPS* | head -5
VOIP_ORIG_INFO,VOIP_DEST_INFO
sip:445600709315@sip.com,sip:999@sip.com
sip:445600709315@sip.com,tel:999
sip:445600702897@sip.com,sip:08007317929@sip.com
sip:445600702897@sip.com,sip:08007317929@sip.com

Please let me know, what would be the filter criteria to find records and filename where these fields are empty.

Thanks,
Ashish.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace 3 fields with null in the file

Hi, I have a file with 104 columns delimited by comma. I have to replace fields 4,5 and 19 with null values and after replacing the columns in the file , the file should be still comma delimited. I am new to shell scripting, Experts please help me out. Thank you (1 Reply)
Discussion started by: vukkusila
1 Replies

2. Shell Programming and Scripting

exclude records with null fields

Hi, can I do something like this to add a condition of checking if the 4th field is number or space or blank also: awk -F, '$4 /^*||*/' MYFILE >> OTHERFILE I also want the other part i.e. I need to exclude all lines whose 4th field is space or blank or number: MYFILE a,b,c,d,e a,b,c,2,r... (2 Replies)
Discussion started by: praveenK_Dudala
2 Replies

3. Shell Programming and Scripting

Find out if few fields in a file are null

Hi, I've a pipe delimited file where I want to find out a number of lines where 1st 2nd and last field are null using awk/sed. Is it possible? Thanks (5 Replies)
Discussion started by: rudoraj
5 Replies

4. Shell Programming and Scripting

how to find null column

Hi, everyone I have a requirement as following: source file 1, abc, def, caaa 2, , cde, aaa 3, bcd, , adefefg I need find columns which contains null value, in above example, I need get two rows 2, , cde, aaa 3, bcd, , adefefg anybody has idea how to achive this ... (5 Replies)
Discussion started by: ken002
5 Replies

5. Shell Programming and Scripting

Aligning output with null fields in shell script

Hello Gurus ! I have what probably amounts to a few simply changes to fix; however for the life of me I cannot seem to get it ti work. I need to align the output of my script (I am writing to a logfile)... here's the lines in my code: if then echo "NODE: $node" >> $logfile... (6 Replies)
Discussion started by: gvolpini
6 Replies

6. Shell Programming and Scripting

Find for line with not null values at nth place in pipe delimited file

Hi, I am trying to find the lines in a pipe delimited file where 11th column has not null values. Any help is appreciated. Need help asap please. thanks in advance. (3 Replies)
Discussion started by: manikms
3 Replies

7. Shell Programming and Scripting

Find fields from one file in the other file

I need to find (basically, grep) matching lines ignoring the first field from file1: field1 field2 field3 field4 field5 field6 id1 carrot white small id2 carrot id3 potato black id4 potato in file2: field1 field2 field3 field4 field5 field6 num1 carrot white ... (2 Replies)
Discussion started by: coppuca
2 Replies

8. UNIX for Dummies Questions & Answers

How to find the null member or blank in the text file?

Hello All, I am new to unix scripting and wanted to know, is it possible if we find any null value or blank record in the text file. For example we have a text file with only one column and there are 90 records. But some times we will have a null value or blank row record in the text file. I... (4 Replies)
Discussion started by: Ram11111
4 Replies

9. Shell Programming and Scripting

Fields shifting in file, do to null values?

The below code runs and creates an output file with three sections. The first 2 sections are ok, but the third section doesn't seem to put a . in all the fields that are blank. I don't know if this is what causes the last two fields in the current output to shift to a newline, but I can not seem... (3 Replies)
Discussion started by: cmccabe
3 Replies

10. Shell Programming and Scripting

To find record having null value

Hi All My requirement is to find the null values in particular column of a file and reject it in case if it contains null values. But the challenge is that I want a common command which can be used across different file, as the position of the column we need to check for different file may get... (14 Replies)
Discussion started by: ginrkf
14 Replies
SELRECORD(9)						   BSD Kernel Developer's Manual					      SELRECORD(9)

NAME
seldrain, selrecord, selwakeup -- record and wakeup select requests SYNOPSIS
#include <sys/param.h> #include <sys/selinfo.h> void seldrain(struct selinfo *sip); void selrecord(struct thread *td, struct selinfo *sip); void selwakeup(struct selinfo *sip); DESCRIPTION
seldrain(), selrecord() and selwakeup() are the three central functions used by select(2), poll(2) and the objects that are being selected on. They handle the task of recording which threads are waiting on which objects and the waking of the proper threads when an event of interest occurs on an object. selrecord() records that the calling thread is interested in events related to a given object. If another thread is already waiting on the object a collision will be flagged in sip which will be later dealt with by selwakeup(). selrecord() acquires and releases sellock. selwakeup() is called by the underlying object handling code in order to notify any waiting threads that an event of interest has occurred. If a collision has occurred, selwakeup() will increment nselcoll, and broadcast on the global cv in order to wake all waiting threads so that they can handle it. If the thread waiting on the object is not currently sleeping or the wait channel is not selwait, selwakeup() will clear the TDF_SELECT flag which should be noted by select(2) and poll(2) when they wake up. seldrain() will flush the waiters queue on a specified object before its destruction. The object handling code must ensure that *sip cannot be used once seldrain() has been called. The contents of *sip must be zeroed, such as by softc initialization, before any call to selrecord() or selwakeup(), otherwise a panic may occur. selwakeup() acquires and releases sellock and may acquire and release sched_lock. seldrain() could usually be just a wrapper for selwakeup(), but consumers should not generally rely on this feature. SEE ALSO
poll(2), select(2) AUTHORS
This manual page was written by Chad David <davidc@FreeBSD.org> and Alfred Perlstein <alfred@FreeBSD.org>. BSD
August 25, 2011 BSD
All times are GMT -4. The time now is 07:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy