coopster - 2:47 pm on Jan 16, 2009 (gmt 0) I learned something new today! Thanks.
I just read up a little on gensub (general substitution) and the reason it looks so familiar is that it is exactly what it appears to be, a regular expression. The first argument is the regex, the second the replacement (in this case a matched subpattern in the regex itself), the third argument here denotes "global" replacement and the last is the target. If no target is specified then the entire input record ($0) is used. So, if you really wanted to you could shorten the command by dropping the last argument in your gensub: gensub(/(.+\/).+/,"\\1","g");
I learned something new today! Thanks.