Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Aug 2020 17:44:35 -0500
From:      Tim Daneliuk <tundra@tundraware.com>
To:        Christoph Kukulies <kuku@kukulies.org>, Ruben via freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Sed pattern help - not FreeBSD related
Message-ID:  <81c68558-175c-efef-7e43-e6cb87f3329b@tundraware.com>
In-Reply-To: <5EFD7C16-FAB5-4CBC-B06A-B0EA6F6BC5BA@kukulies.org>
References:  <6B02E882-D3EE-4721-B572-BFAF5C6BAC66@kukulies.org> <5EFD7C16-FAB5-4CBC-B06A-B0EA6F6BC5BA@kukulies.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 8/25/20 4:02 PM, Christoph Kukulies wrote:
> Excuses, the result should look like: (forgot the DC)
> 
>> LOOP:   DC LOOP+2
>> DO:	      DC DO+2
>> J:	     DC J+2
>> ENCL:	DC ENCL+2  PDP-11 VERSION OF ENCLOSE
>> KEY	     DC KEY+2
>> EMIT	DC EMIT+2
>> QTERM	DC QTERM+2

Here is a  one-liner using sed and awk.  It suffers from two deficiencies:

- It does not handle arbitrarily long comments
- It's really ugly

   sed s/':'//g < myfile | awk '{print $1":", $2, $1"+2", $4, $5, $6, $7, $8, $9. $10}'

-- 
----------------------------------------------------------------------------
Tim Daneliuk     tundra@tundraware.com
PGP Key:         http://www.tundraware.com/PGP/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?81c68558-175c-efef-7e43-e6cb87f3329b>