Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Feb 2008 16:11:58 +0700
From:      Eugene Grosbein <eugen@kuzbass.ru>
To:        Szemer?dy G?bor <gaborszem@eccf.su.ac.yu>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Inserting a character in certain column
Message-ID:  <20080225091158.GA29263@svzserv.kemerovo.su>
In-Reply-To: <47C30055.5010401@eccf.su.ac.yu>
References:  <47C30055.5010401@eccf.su.ac.yu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 25, 2008 at 09:52:21AM -0800, Szemer?dy G?bor wrote:

> I need to insert a character in certain column in all rows of the file 
> using vi.
> Please help

I don't use vi but remember it can use regexp like sed does:
the following examle inserts X after 5th column (read, in 6 column):

sed -E 's/^(.{5})(.*)/\1X\2/'

Eugene Grosbein



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080225091158.GA29263>