The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: Loop help
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 06-27-2006
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,798
Your requirements are not clear.

My take:
You want two files:
one with all the good data
another file with just unique bad data
Criterion for good/bad:
good data = record length less than equal to 106.


Code:
awk 'length($0)>106' reads | sort -u > bad.daily
awk 'length($0)<=106' reads > good.daily