Useful commands and macros that you'll probably forget.
:5,8del | let x=split(@") | 1,4s/$/\=remove(x,0)/
Example:
1| work it 1| work it harder
2| make it 2| make it better
3| do it 3| do it faster
4| makes us 4| makes us stronger
5| harder
6| better
7| faster
8| stronger
:%s/[^total:]*$//g
Example:
Before...
|product_id:1151|sku:|quantity:1|total:10
|product_id:1301|sku:|quantity:1|total:10
|product_id:1301|sku:|quantity:1|total:10
|product_id:1151|sku:|quantity:1|total:10
|product_id:1301|sku:|quantity:1|total:50
After...
|product_id:1151|sku:|quantity:1|total:
|product_id:1301|sku:|quantity:1|total:
|product_id:1301|sku:|quantity:1|total:
|product_id:1151|sku:|quantity:1|total:
|product_id:1301|sku:|quantity:1|total:
:%s/.*[total]/total/g
Example:
Before...
|product_id:1151|sku:|quantity:1|total:10
|product_id:1301|sku:|quantity:1|total:10
|product_id:1301|sku:|quantity:1|total:10
|product_id:1151|sku:|quantity:1|total:10
|product_id:1301|sku:|quantity:1|total:50
After...
total:10
total:10
total:10
total:10
total:50