Search Results

Search: Posts Made By: reshma15193
15,595
Posted By Don Cragun
I think you're missing a pair a braces: awk...
I think you're missing a pair a braces:
awk -F'|' '{
if( $3=="" || $5=="" || $7=="" || $8=="" ) {
if ( $3=="" ) { print "Line ",NR, " Field 3: Mandatory field is null"; }
if...
15,595
Posted By RudiC
How about making it a bit more flexible? Tryawk '...
How about making it a bit more flexible? Tryawk '
NR==1 {MX = split(CHK, T, ",")
}
{for (i=1; i<=MX; i++)
if ($(T[i]) == "") print "column " T[i] " is null at line "...
15,595
Posted By stomp
Thanks. Changed That.
Thanks. Changed That.
15,595
Posted By Scrutinizer
Like so? awk -F \| '{for(i=3; i<=8; i++)...
Like so?
awk -F \| '{for(i=3; i<=8; i++) if(i!=4) if($i=="") printf "%s\n","column " i " is null at line " NR}' file


---
@stomp:
You cannot use !$i or for example!$3 as a test, since then the...
15,595
Posted By stomp
Hi, Something like this: awk -F'|' '{ ...
Hi,

Something like this:

awk -F'|' '{
if( $3=="" || $5=="" || $7=="" || $8=="" )
if ( $3=="" ) { print "Line ",NR, " Field 3: Mandatory field is null"; }
if ( $5=="" )...
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 11:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy