tabular icon indicating copy to clipboard operation
tabular copied to clipboard

string on left and number align right

Open belisair opened this issue 10 years ago • 2 comments

Hi guys,

thank you for your vim plugin. As data expert, I'm spending my life on csv files and probably use your plugin 20 times per day. However I have request to you:

could it be possible to align by default any number on right and any string on the left (which is the default behaviour) ?

Here is a quick example:

WORD          | COUNT | SUM      
Edinburgh     | 9     | 2092235  
London        | 12    | 3339260  
New York      | 11    | 3588090  
San Francisco | 14    | 3293475  
Sidney        | 2     | 181000   
Singapore     | 4     | 913725   
Tokyo         | 5     | 963925   
TOTAL         | 57    | 14371710 

It would save me a lot of time to directly format it like the following:

WORD          | COUNT | SUM      
Edinburgh     |     9 |  2092235  
London        |    12 |  3339260  
New York      |    11 |  3588090  
San Francisco |    14 |  3293475  
Sidney        |     2 |   181000   
Singapore     |     4 |   913725   
Tokyo         |     5 |   963925   
TOTAL         |    57 | 14371710 

belisair avatar Sep 16 '14 14:09 belisair

hi, you can do it like this:

:Tabularize /|/l2r2r2

liangguohuan avatar Jan 24 '15 11:01 liangguohuan

Hi, thank you for you're input. If there is no possibility to set a default alignement for certain type (text, number, etc.), I will use this solution.

belisair avatar Feb 04 '15 12:02 belisair