Column in Vim

Does anyone know how to sum all columns in a table in Vim without using AWK or SED but vimscript?

I want to select the columns that I want to sum and have the value below

like this:

2,50       € 2,50
25         € 2.200,40
0,30       € 0,309
100        € 1.400,3
23,50      € 23,5
Sum col1   Sum col2


This is a two column example, but I often have more columns.
The problem I am facing with awk is that it cannot handle the decimal separator "," and the thousandth order.


source to share

1 answer

I would recommend taking a look at the source of csv.vim , it has SumColumn

IIRC feature in ftplulgin.



All Articles