Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and 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 Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 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 Unix and Linux 01-30-2013
Scrutinizer's Unix or Linux Image
Scrutinizer Scrutinizer is offline Forum Staff  
Moderator
 
Join Date: Nov 2008
Last Activity: 2 August 2015, 2:59 AM EDT
Location: Amsterdam
Posts: 10,349
Thanks: 351
Thanked 2,744 Times in 2,453 Posts
Try:

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


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

Sponsored Links
    #3  
Old Unix and Linux 01-30-2013
neutronscott's Unix or Linux Image
neutronscott neutronscott is offline Forum Advisor  
script kiddie
 
Join Date: Jun 2011
Last Activity: 31 July 2015, 12:12 PM EDT
Location: South Carolina, USA
Posts: 904
Thanks: 30
Thanked 288 Times in 269 Posts

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

    #4  
Old Unix and Linux 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 Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 08:22 PM.