質問

I have a file of data in emacs whose columns are separated by tabs, but the default tab spacing of 8 is not enough for some values, so the layout is not in nice columns. Please, how do I alter the tab spacing to 10, or better still: can I set individual columns to have different spacings.

Here is the first few lines of the file:

CALL    CHAN    OUTPUT  INPUT   QTHR    LOCATION        NGR     REGION  CTCSS   KEEPER  Internet
GB3AA   23cm    1297     1291   IO81RO  Alveston,Avon   ST62608820      SW ENG  118.8   G4CJZ    
GB3AE   R50-1   50.72    51.22  IO71PR  Tenby   SN11900580      WALES   94.8    GW0WBQ   
GB3AG   RV58    145.725  145.125        IO86ON  Forfar  NO48904170      SCOT    94.8     GM1CMF Echolink
GB3AH   RB11    433.275  434.875        JO02KP  East Dereham    TF94300990      EAST ENG        94.8    G8PON    
        GB3AI   RV55    145.6875        145.0875        IO91QQ  Amersham        SU97089767      SW ENG  77      G0RDI   Echolink
GB3AL   RV59    145.7375        145.1375        IO91QP  Amersham        SU95709550      SW ENG  77      G0RDI    
GB3AM   R50-13  50.84    51.34  IO91QP  Amersham        SU95709550      SW ENG  77      G0RDI    
役に立ちましたか?

解決 4

Thanks to all for the replies and comments. Thanks especially to abo-abo whose comment led me to a solution in emacs, which is: 1) reload the original file, which has tab separated columns 2) use the command org-mode 3) select the whole file 4) use the command org-table-convert-region 5) this gave me the desired result:

| CALL  | CHAN   |   OUTPUT |    INPUT | QTHR   | LOCATION       | NGR        | REGION   | CTCSS | KEEPER | Internet |
| GB3AH | RB11   |  433.275 |  434.875 | JO02KP | East Dereham   | TF94300990 | EAST ENG |  94.8 | G8PON  |          |
| GB3AS | RV48   |    145.6 |      145 | IO84LS | Wigton,Cumbria | NY33724123 | N.ENG    |    77 | G4KFN  |          |
| GB3AG | RV58   |  145.725 |  145.125 | IO86ON | Forfar         | NO48904170 | SCOT     |  94.8 | GM1CMF | Echolink |
| GB3AY | RV52   |   145.65 |   145.05 | IO75OR | Dalry          | NS26605190 | SCOT     | 103.5 | GM3YKE |          |
| GB3BA | RB01   |  433.025 |  434.625 | IO87SC | Banchory       | NJ72150255 | SCOT     |    67 | GM1XEA |          |
| GB3BD | RB06   |   433.15 |   434.75 | IO92RA | Ampthill       | TL01303860 | SE ENG   |    77 | G8MGP  |          |
| GB3AA | 23cm   |     1297 |     1291 | IO81RO | Alveston,Avon  | ST62608820 | SW ENG   | 118.8 | G4CJZ  |          |
| GB3AI | RV55   | 145.6875 | 145.0875 | IO91QQ | Amersham       | SU97089767 | SW ENG   |    77 | G0RDI  | Echolink |
| GB3AL | RV59   | 145.7375 | 145.1375 | IO91QP | Amersham       | SU95709550 | SW ENG   |    77 | G0RDI  |          |
| GB3AM | R50-13 |    50.84 |    51.34 | IO91QP | Amersham       | SU95709550 | SW ENG   |    77 | G0RDI  |          |

他のヒント

Set the tab-width variable to a higher number. To set it to 20, for example, enter M-xset-variableEntertab-widthEnter20Enter.

You might like to try csv-mode, which is in GNU ELPA.

Try using ses-mode.

You'll have to insert the values by cut/pasting them into a new file (e.g. temp.ses), but once you've done that, you'll be able to navigate through fields really easily.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top