The UNIX and Linux Forums  

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



Thread: Filtering Data
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 09-04-2007
Raynon Raynon is offline
Registered User
 

Join Date: Sep 2006
Location: Sg
Posts: 323
Thnks Jean it works!!

However, how can i modify the code such that when 2 or more terms are repeated consecutively, it will output the the repeating term, else echo "No consecutive repeating term ?

Input:
vvvvv 20 7 7 23 0 64
uuuuu 17 0 0 24 0 146
uuuuu 17 0 0 24 0 146
uuuuu 17 0 0 24 0 146
ggggg 11 5 5 13 0 13
yyyyy 13 7 7 31 0 252
ggggg 11 5 5 13 0 13


Expected Output:
Consecutive Repeating term = uuuuu 17 0 0 24 0 146

Last edited by Raynon; 09-04-2007 at 10:56 PM..
Reply With Quote