RE: OT: Using sed - guru help wanted.

2003-10-22 Thread Hannu E K Nevalainen
> From: erik dot cumps at icos in belgium > Sent: Tuesday, October 21, 2003 11:36 AM Hmm... email-address visible; you ought to conceal it a bit more. Otherwise you'll eventually end up receiving spam. It has started over here :-7 > Hi guys, > > sorry if this thread was dead but couldn't resist

RE: OT: Using sed - guru help wanted.

2003-10-21 Thread erik . cumps
Hi guys, sorry if this thread was dead but couldn't resist. Besides, it makes the start of my workday just that more bearable... :) (regular expressions for fun and profit eh) Simply sed: sed 's#^ *\(.*[^ ]\) */ *\(.*[^ ]\) *$#.\1.\2.#' Simply perl: perl -pe 's/^\s*(.*\S)\s*\/\s*(.*\S)

RE: OT: Using sed - guru help wanted.

2003-10-20 Thread Hannu E K Nevalainen
> From: Brian Dessent > Sent: Monday, October 20, 2003 10:43 PM > Hannu E K Nevalainen wrote: > > > $ echo ' a b / c d e ' | \ sed -e 's/ *\(.*\) *\/ *\(.*\) */.\1.\2./' > > > > .a b .c d e . > > > > I want the output to be '.a b.c d e.' - that is; strip out the > > trailing spaces. > > > > HOW

Re: OT: Using sed - guru help wanted.

2003-10-20 Thread Brian Dessent
Hannu E K Nevalainen wrote: > $ echo ' a b / c d e ' | \ > sed -e 's/ *\(.*\) *\/ *\(.*\) */.\1.\2./' > .a b .c d e . > > I want the output to be '.a b.c d e.' - that is; strip out the trailing > spaces. > > HOW do I achieve that? ( \s = any ws, \S = any non ws ) > > Obviously \(.*\) grabs/i

Re: OT: Using sed - guru help wanted.

2003-10-20 Thread Igor Pechtchanski
On Mon, 20 Oct 2003, Hannu E K Nevalainen wrote: > [snip] > HOW do I achieve that? ( \s = any ws, \S = any non ws ) > > Obviously \(.*\) grabs/includes the last space. My brain has stoppped > working, so right now I can't work around that :-I Reversed character lists, e.g. '[^ ]', should work po