Sponsored Content
Top Forums Shell Programming and Scripting Find out if few fields in a file are null Post 302364151 by rdcwayx on Thursday 22nd of October 2009 07:50:22 AM
Old 10-22-2009
Code:
Wrong one, ignore it. awk -F\| '{$1=$2=$NF=""}'1 urfile

Quote:
Originally Posted by rudoraj
Great this gives number of recrods. Would it be possible to print the lines instead?

Thanks
Code:
awk -F\| ' !$1 || !$2 || !$NF { print $0 }'


Last edited by rdcwayx; 10-22-2009 at 09:18 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

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... (2 Replies)
Discussion started by: rahulrathod
2 Replies

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

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

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
Locale::Codes::LangVar(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangVar(3pm)

NAME
Locale::Codes::LangVar - standard codes for language variation identification SYNOPSIS
use Locale::Codes::LangVar; $lvar = code2langvar('acm'); # $lvar gets 'Mesopotamian Arabic' $code = langvar2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langvar_codes(); @names = all_langvar_names(); DESCRIPTION
The "Locale::Codes::LangVar" module provides access to standard codes used for identifying language variations, such as those as defined in the IANA language registry. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language registry codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language variations. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lvar = code2langvar('en','alpha-2'); $lvar = code2langvar('en',LOCALE_CODE_ALPHA_2); The codesets currently supported are: alpha This is the set of alphanumeric codes from the IANA language registry, such as 'arevela' for Eastern Armenian. This code set is identified with the symbol "LOCALE_LANGVAR_ALPHA". This is the default code set. ROUTINES
code2langvar ( CODE [,CODESET] ) langvar2code ( NAME [,CODESET] ) langvar_code2code ( CODE ,CODESET ,CODESET2 ) all_langvar_codes ( [CODESET] ) all_langvar_names ( [CODESET] ) Locale::Codes::LangVar::rename_langvar ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangVar::add_langvar ( CODE ,NAME [,CODESET] ) Locale::Codes::LangVar::delete_langvar ( CODE [,CODESET] ) Locale::Codes::LangVar::add_langvar_alias ( NAME ,NEW_NAME ) Locale::Codes::LangVar::delete_langvar_alias ( NAME ) Locale::Codes::LangVar::rename_langvar_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangVar::add_langvar_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangVar::delete_langvar_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2012 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-10-11 Locale::Codes::LangVar(3pm)
All times are GMT -4. The time now is 12:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy