help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to insert a string every 2 characters


From: Angus Comber
Subject: Re: How to insert a string every 2 characters
Date: Sat, 22 Aug 2015 15:58:05 +0100

That didn't work quite how I wanted.  It just replaces 2 characters with a
space.  But I I did like this:

c-m-% \(..\)

and replace with \1

with a space after \1 that works.



On 22 August 2015 at 15:45, <address@hidden> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Sat, Aug 22, 2015 at 02:37:39PM +0100, Angus Comber wrote:
> > Hi
> >
> > If I have a string of characters like this:
> >
> > 0102030405
> >
> > I want to transform into:
> >
> > 01 02 03 04 05
> >
> > How do I do that?
>
> The short answer: query-replace-regexp RET .. RET ..<SPACE>
> (substitute the <SPACE> there by a real space, of course).
>
> The long answer: do you have many strings like that? Just
> one? How long are they? Do you have to do that very often?
>
> regards
> - -- tomás
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iEYEARECAAYFAlXYixgACgkQBcgs9XrR2kYEFgCfaH9b0KrzKLtzhmnbZdFCcOcT
> cwUAn2IoQB2aFnp9EfA1YAdCMri57sED
> =npOb
> -----END PGP SIGNATURE-----
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]