Find for line with not null values at nth place in pipe delimited file | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

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

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-30-2013
manikms manikms is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 7 February 2013, 11:56 AM EST
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Linux 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.
Sponsored Links
    #2  
Old 01-30-2013
Scrutinizer's Avatar
Scrutinizer Scrutinizer is offline Forum Staff  
Moderator
 
Join Date: Nov 2008
Last Activity: 1 October 2014, 3:01 PM EDT
Location: Amsterdam
Posts: 9,488
Thanks: 280
Thanked 2,398 Times in 2,150 Posts
Try:

Code:
awk -F\| '$11x' file


Code:
awk -F\| 'x$n' n=11 file

Sponsored Links
    #3  
Old 01-30-2013
neutronscott's Avatar
neutronscott neutronscott is offline Forum Advisor  
script kiddie
 
Join Date: Jun 2011
Last Activity: 28 September 2014, 7:20 PM EDT
Location: McMurdo Station, Antarctica
Posts: 796
Thanks: 28
Thanked 237 Times in 224 Posts

Code:
awk -F'|' '$11' file

    #4  
Old 02-01-2013
manikms manikms is offline
Registered User
 
Join Date: Jan 2013
Last Activity: 7 February 2013, 11:56 AM EST
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
solution syntax


Code:
awk 'BEGIN {FS="|"} $11!="" {print}' ccn.txt > test.txt


this gives the result to what I am looking for..

thanks all for the responses shared..

Last edited by Scrutinizer; 02-01-2013 at 10:49 AM.. Reason: code tags
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Using AWK to find top Nth values in Nth column ncwxpanther Shell Programming and Scripting 3 04-11-2012 12:59 PM
find string and get the rest of the line in a pipe delimited file kokoro UNIX for Dummies Questions & Answers 11 02-17-2012 01:36 AM
how to Insert values in multiple lines(records) within a pipe delimited text file in specific cols vasan2815 Shell Programming and Scripting 4 11-14-2011 06:00 AM
count of null in pipe delimited txt file Sriranga Shell Programming and Scripting 5 09-22-2011 03:30 AM
Grep for NULL in a pipe delimited file sureshg_sampat Shell Programming and Scripting 5 11-21-2006 05:15 AM



All times are GMT -4. The time now is 10:21 PM.