Date: Thu, 13 Jan 2011 06:28:19 +0100
From: Polytropon free...@edvax.de
Subject: awk question: replacing %d%s by %d %s
I'm aware that this is not an awk question list, but I'm confident there
are many awk gurus here who can surely help me with such a stupid
problem. I also know that I
On Thu, 13 Jan 2011 18:22:18 -0600 (CST), Robert Bonomi
bon...@mail.r-bonomi.com wrote:
True. But
sub(nr,[a-z], );
does the trick. (tested on Freebsd 7.2)
Explamation: is a 'replacement side' magic incantation to the regex
library that means 'that which was matched by the
On Fri, 2011-01-14 at 07:17 +0100, Polytropon wrote:
On Thu, 13 Jan 2011 18:22:18 -0600 (CST), Robert Bonomi
bon...@mail.r-bonomi.com wrote:
True. But
sub(nr,[a-z], );
does the trick. (tested on Freebsd 7.2)
Explamation: is a 'replacement side' magic incantation to the
On Fri, 14 Jan 2011 17:53:04 +1030, Wayne Sierke w...@au.dyndns.ws wrote:
I suspect it is a transcription error by Robert in his email.
From man awk:
sub(r, t, s)
substitutes t for the first occurrence of the regular
expression
r in the string s. If s
I'm aware that this is not an awk question list, but I'm
confident there are many awk gurus here who can surely
help me with such a stupid problem. I also know that I
get more and more stupid myself for NOT being able to
solve this, even after... some nearly infinite time. :-)
I have strings of
On Thu, 13 Jan 2011 01:00:17 -0500, Tom Limoncelli t...@whatexit.org wrote:
$ awk data.txt experiment.txt '{ num = $1 ; sub(/[^0-9]+$/, ,
num) ; lets = $1 ; sub(/^[0-9]+/, , lets); print num lets }' ;
diff -cw control.txt experiment.txt
$ # The above puts a space at the end of the first 3
On Thu, Jan 13, 2011 at 12:28 AM, Polytropon free...@edvax.de wrote:
I have strings of the form either number(s) or
number(s)letter. I catch them with
...
where nr is the name of the string. What I need
is a simple space between number(s) and letter,
so for example 12a would get 12 a, 6d