PDA

View Full Version : return column number of matching string



professor_chaos
October 10th, 2006, 05:34 PM
does anyone know how to from the shell...return the column number of matching strings.

example file contents

a b c d e f g


what I want is to search for the string "d" and return its column number (ie 4). In this case each column is defined by white space.
I appreciate any help.
Thanks

D