Wednesday, March 14, 2018

Re: sorting file content by third numbered column

On 13.03.18 07:41, Ni Va wrote:
> The csv file attached below it produced from this code particularly by from s:results list of strings.
>
> I import it into excel and then do a sort from max to min spent time by third column.
>
> I would do the same from this vimscript below on in order to sort by numeric float Total time column

[Miles long inscrutably complex vimscript elided.]

Vim is not emacs, so it does not burden itself with diverse
functionality in the same way - and yet it has an inbuilt sort. OK, that
apparently does not suffice for your requirements.

Then the task is much more efficiently executed by existing tools
designed for it. Have a look at "man sort". In a single short command
line, you can replace all the wasteful complexity of a miles long
inscrutable vimscript, instead handling which field to sort on, field
separator, forward/reverse sort, numeric or alpha, etc. I repeat, one
short line.

A hammer can be used as a screwdriver, but only if you treat the screw
as a nail. Results are likely to be disappointing.

Erik

--
I have yet to see any problem, however complicated, which, when you
looked at it in the right way, did not become still more complicated.
- Poul Anderson

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: