File processing


 
Thread Tools Search this Thread
# 1  
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 08:31 AM.. Reason: Code tags, please!
 

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

More UNIX and Linux Forum Topics You Might Find Helpful
awk processing / Shell Script Processing to remove columns text file
ajayram
Hello, I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this : This is the output of ls command : I stored the output in a file filelist 1.1M...... Programming
5
Programming
How to make parallel processing rather than serial processing ??
Samb95
Hello everybody, I have a little problem with one of my program. I made a plugin for collectd (a stats collector for my servers) but I have a problem to make it run in parallel. My program gathers stats from logs, so it needs to run in background waiting for any new lines added in the log...... Shell Programming and Scripting
0
Shell Programming and Scripting
how to change the current file processing to some other random file in awk ?
salman4u
Hello, say suppose i am processing an file emp.dat the field of which are deptno empno empname etc now say suppose i want to change the file to emp.lst then how can i do it? Here i what i attempted but in vain BEGIN{ system("sort emp.dat > emp.lst") FILENAME="emp.lst" } { print...... Shell Programming and Scripting
2
Shell Programming and Scripting
Have a shell script check for a file to exist before processing another file
heprox
I have a shell script that runs all the time looking for a certain type of file and then it processes the file through a series of other scripts. The script is watching a directory that has files uploaded to it via SFTP. It already checks the size of the file to make sure that it is not still...... Shell Programming and Scripting
3
Shell Programming and Scripting