From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: erik quanstrom Date: Thu, 17 Sep 2009 13:04:57 -0400 To: 9fans@9fans.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] awk help; not plan9 matter Topicbox-Message-UUID: 711cf904-ead5-11e9-9d60-3106f5b1d025 > As I said in my second post, neither the field (the problem with sed) > nor the string to be used as a replacement (no problem) is not known > in advance... > Apparently nobody reads but the 1st post... :) why would it be hard to build up the regular expression with a script? something like this (untested, getting lazy) # usage: buildre n replacement fn buildre { re = '^' for(i in `{seq 1 $1}) re = $re ^ '([^ ][ ]*)' re = $re ^ ([^ ]):\' ^ $2 ^ ':' } - erik