The UNIX and Linux Forums  

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


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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to use sed modify specific lines Jenny.palmy UNIX for Dummies Questions & Answers 5 05-18-2008 03:17 AM
Printing Dots in specific Locations in the Console ? Max_Payne High Level Programming 0 01-12-2008 08:57 PM
Printing specified lines only Mohit623 Shell Programming and Scripting 4 01-03-2008 04:55 AM
viewing specific lines dakid UNIX for Dummies Questions & Answers 3 05-25-2006 12:25 AM
Inserting specific lines in vi giannicello UNIX for Dummies Questions & Answers 2 05-01-2002 05:10 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-13-2007
Registered User
 

Join Date: Mar 2007
Posts: 6
Printing lines with specific awk NF

I have this files:
./frm/lf_mt1_cd.Ic_cell_template.attr
./die/addgen_tb_pumd.Ic_cell_template.attr
./min_m1_n.Ic_cell_template.attr

When I use:
awk -F\/ '{print NF}'

Would result to:
3
3
2

I would like to list the files with 3 fields on it. Any Suggestions?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-13-2007
Playing with Ubuntu Now!
 

Join Date: Oct 2005
Location: Chennai
Posts: 364
Explanation required

Just use
Code:
awk -F\/ 'NF == 3' filename
Please format what you type using the tags available. It will be more readable.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:38 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0