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

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

Re: Is it possible to move a column where column on right is variable wi


From: Tomas Nordin
Subject: Re: Is it possible to move a column where column on right is variable width
Date: Tue, 16 May 2017 20:51:25 +0200

> which is of the form:
>
> symbol<tab>Description
>
> the description is pretty free form.  Here are some examples:
>
> 06GG.L        BARCLAYS BANK PLC UNDATED FLTG RATE PRIM CAP NOTES'2'USD
> 06GL.L        NATIONAL GRID GAS 8.75% BDS 27/6/25 GBP(VAR)
> 07OZ.L        HAMMERSON PLC 6.875% BDS 31/3/20 GBP(VAR)
>
> What I would like to do is swap so it displays:
> Description<tab>Symbol.
>

Here is a suggestion using GNU sed

C-x h          mark-whole-buffer
C-u M-|        shell-command-on-region (with prefix to output in buffer)

then yank this as the shell command
sed -E 's/(.+)\t(.+)/\2\t\1/'

and hope there was no tabs in the description.

--
Tomas



reply via email to

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