Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting


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

Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-30-2013
Registered User
 
Join Date: Jan 2013
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
Moderator
 
Join Date: Nov 2008
Location: Amsterdam
Posts: 7,353
Thanks: 144
Thanked 1,756 Times in 1,593 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
script kiddie
 
Join Date: Jun 2011
Location: Charleston, SC
Posts: 649
Thanks: 18
Thanked 189 Times in 179 Posts

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

    #4  
Old 02-01-2013
Registered User
 
Join Date: Jan 2013
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
Reply

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 11:11 PM.