cat data.txt | sort -k 8n
10 FTP 000105606 59204 00000200733301006A1 N NAME F
11 FTP 000105606 59204 00000200733301002A1 N NAME F
12 FTP 000105606 59204 00000200733301004A1 N NAME 6
13 FTP 000105606 59204 00000200733201002A1 N NAME F
14 FTP 000105606 59204 00000200733301000A1 N NAME F
9 FTP 000105606 59204 00000200733401001A1 N NAME F
8 FTP 000105607 59205 00000200805101028A1 N NAME 9
3 FTP 232190010 00121 00000200812701437A1 N NAME 9
1 FTP 294243080 16976 00000200812804587A1 N NAME F
3 FTP 432817773 17014 00000200812705212A1 N NAME 7
3 FTP 538105321 00007 00000200812801004A1 N NAME 7
-Thanks
> Is it possible in vim to sort the data below, similar to using the
> external sort to sort on say the 8th column like:
>
> cat data.txt | sort -k 8n
:sort /.*\%8v/
:help :sort
--
Patrick Texier
vim:syntax=mail:ai:ts=4:et:tw=72
Or select the lines you wish to sort using the Capital V command.
Then enter
!sort -k 8n
I believe the example the OP cites is better solved as
:sort /.*\%55v/
The 'virtual' specification is the absolute column number, which treats
spaces and tabs as a single character (in other words, it does NOT count
tabs as 8 spaces (or whatever your tab settings are).
In the case cited by the OP, working with the assumption that all
whitespaces are space characters, the eighth column starts at character
number 55.
-Fionn