File processing

Tags
beginners

 

 
Thread Tools Search this Thread
# 1  
Old 11-25-2009
File processing

Hi,

I have file having 10 coloumns in each row. I need to remove those line which does not have 10 coloumns, like if a row has more than 10 coloumns then remove that line similalry if the row has less than 10 coloumns then remove that line.


File1.txt

Code:
1   2    3    4   5   6   7   8    9   10
1   2    3    4   5   6   7   8    9   10
1   2    3    4   5   6   7   8    9   10   11  12   13
1   2    3    4   5   6   7   8    9   10
1   2    3    4   5   6   7   
1   2    3    4   5   6   7   8    9   10

From above file. I need to remoce line number 3 (contains 13 coloumns) and line number 5(Contains 7 coloumns).

So the Final output file should have

Code:
1   2    3    4   5   6   7   8    9   10
1   2    3    4   5   6   7   8    9   10
1   2    3    4   5   6   7   8    9   10
1   2    3    4   5   6   7   8    9   10

Can any one help me out?

Thanks,
Siba

Last edited by vgersh99; 11-25-2009 at 09:31 AM.. Reason: Code tags, please!
# 2  
Old 11-25-2009
Code:
nawk 'NF==10' File1.txt

# 3  
Old 11-25-2009
Great.... nawk is not available, I tried with awk and it works.

Thanks a lot.
 

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
File Processing nikhil jain Shell Programming and Scripting 3 03-29-2017 04:37 AM
awk - Rename output file, after processing, same as input file High-T UNIX for Dummies Questions & Answers 12 02-01-2015 09:34 PM
File processing ATWC Shell Programming and Scripting 8 03-09-2014 06:31 AM
awk processing / Shell Script Processing to remove columns text file ajayram Programming 5 03-23-2013 02:51 PM
Recursive file processing from a path and printing output in a file Optimus81 Shell Programming and Scripting 1 12-14-2012 12:55 PM
Help with File processing karumudi7 Shell Programming and Scripting 7 10-10-2011 04:34 PM
File Processing expert Shell Programming and Scripting 2 05-07-2011 01:42 AM
Help in file processing selvam Shell Programming and Scripting 6 04-16-2011 11:25 PM
How to make parallel processing rather than serial processing ?? Samb95 Shell Programming and Scripting 0 08-16-2010 04:56 AM
help with processing a file dsravan Shell Programming and Scripting 4 06-16-2010 02:22 PM
How to processing the log file within certain dates based on the file name shyork2001 Shell Programming and Scripting 1 04-09-2010 11:58 AM
how to change the current file processing to some other random file in awk ? salman4u Shell Programming and Scripting 2 03-02-2009 04:35 AM
Checking for a control file before processing a data file purna.cherukuri Shell Programming and Scripting 4 09-01-2008 11:52 AM
Have a shell script check for a file to exist before processing another file heprox Shell Programming and Scripting 3 11-14-2006 03:26 AM