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: Kaushal Modi
Subject: Re: Is it possible to move a column where column on right is variable width
Date: Tue, 16 May 2017 17:38:21 +0000

On Tue, May 16, 2017 at 12:35 PM Angus Comber <anguscomber@gmail.com> wrote:

> I downloaded a file, LSE.txt from this link:
>
> http://www.eoddata.com/Data/symbollist.aspx?e=LSE


I cannot access that site without a login, but I used the below data
snippet of yours.


> 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)
>
> Is there any way to do what I want?
>

As the Description portion of the data is not of equal width, using
rectanges gets tricky.

A simple query-replace-regexp works in this case.

1. M-x query-replace-regexp (or C-M-%)
2. Enter this in the first field:
      ^\([^[:space:]]+\)[[:space:]]+\(.+\)
    and hit return.
3. Enter this in the next field:
      \2 \1 (or, \2 C-q TAB \1)
    and hit return
4. Hit ! to execute that search/replace for all hits.


-- 

Kaushal Modi


reply via email to

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