The UNIX and Linux Forums  


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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-22-2007
prkfriryce prkfriryce is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 44
yet another awk field syntax question

I am trying to print the remaing fields and field numbers beginning with a field 'xyz'


Code:
#cat abc
test1:test2:xyz:test3:test4:test5

#cat def
test1:test2:test3:xyz:test4:test5

desired output is to be able to print NF and any trailing fields separated by':'

test3 3
or
test4 3
or
test5 3

likewise,

test4 2
or
test5 2

placeing a field separator as 'xyz' illiminates using ':' as a second separator or is that possible?