From: Robert Klemme Date: 2011-05-16T22:10:47+09:00 Subject: Re: Linux utility with reverse index facility? On Mon, May 16, 2011 at 2:40 PM, David Brown wrote: > On 16/05/2011 12:38, no.top.post@gmail.com wrote: >> >> awk&stuff can "give me the the Nth element", >> but, without writing your own search-loop, >> what can "give me the index of the 'element' >> which is" ? >> >> I think it's called 'reverse indexing' ? > Why not write your own loop?  Use your favourite scripting language. You > haven't described your problem very well, but my guess it is should be easy > to do in a perl or python script (read in the file, put the data through > lists, hashes/dicts, sorts, etc., as needed). > > I don't know enough about awk or ruby to say if they can handle it easily. Now that I reread the original posting it seems grep family's option -n does the job as well. But I do agree, the problem description is quite foggy. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/