Sunday, July 21, 2013

using !sort in windows commandline: passing special characters

I use cygwin on my windows system to use unix commands from vim commandline.

This is written in my text file:
Adam|12345
Bob|34567
Joe|56789
Sam|45678
Wendy|23456

When I use:

:%!sort -k2n -t'|'

it gives an error:
''' is not recognized as an internal or external command, operable program or batch file.

Same problem when I use '>' and '<' as separator.
Escaping doesn't resolve my problem.
I don't have problems with other separators as ';', ')', '\\', '=' and many others.

btw....
Is it possible to use regex in the sort command. No info is written in the manual and it doesn't work in my vim.

:%!sort -k3 -t'[,;]'

(sort after the 3rd time a ',' or ';' is found)

--
--
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/groups/opt_out.

No comments: