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: Loris Bennett
Subject: Re: Is it possible to move a column where column on right is variable width
Date: Wed, 17 May 2017 08:22:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Angus Comber <anguscomber@gmail.com> writes:

> I downloaded a file, LSE.txt from this link:
>
> http://www.eoddata.com/Data/symbollist.aspx?e=LSE
>
> 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.
>
> I tried using rectangles, eg:
>
> set mark at top left buffer, C-space select area, ie selected area is
> all of Symbols column Then c-x r k to remove the symbols from 1st
> column and save to the rectangle kill ring.  then I replace $ with
> tab.
>
> Then I navigate to the end of the first line and try c-x r y - but
> that inserts the symbols into the middle of the Descriptions.
>
> Is there any way to do what I want?

You could convert to a an Org mode table, reorder the columns and, if
needed, convert back to plain(er) text:

1. M-x orgtbl-mode
2. Highlight the lines
3. Do C-c | (or M-x orgtbl-create-or-convert-from-region)
4. With the cursor in the left-hand column, do M-<right arrow>
5. Replace the |-symbols 

Cheers,

Loris

-- 
This signature is currently under construction.


reply via email to

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