Please see the updated code: http://vim.wikia.com/wiki/Working_with_CSV_files
I'm using Vim's str2float() to convert a field to a float. A field like "1.25junk" will be regarded as 1.25. A field like "junk1.25" will be regarded as a string and will sort before numbers. Hi John: With the updated code,the result of the example I post above with the ":Sort 1 n" is: ===Result Begin=== num,md51,fullpath_filename,fullname2, -3.45,10D0BA441255894A51C8B3308EB11638,X:\I386\0410.CS_,0410.csv, -1.90,45158FF10F952BCFC590ECB2C80D487E,X:\I386\0414.CS_,0414.csv, 0.123,59D691289820021216E6CDCAD74743D4,X:\I386\0419.CS_,0419.csv, 0.175,FF5EA7161307D7170C39D31629239CDF,X:\I386\BOPOMOFO.UC_,bopomofo.UCE, 0.362,FF6223C000741845CE8CD0C6336021D1,X:\I386\D3DXOF.DL_,d3dxof.dll, -0.34,FF762A792EFCB11C917A2682352F71D1,X:\I386\HPCRDP.CA_,hpcrdp.cat, 1.723,3ECA13B43EF48F80F0179856A73A3BA6,X:\I386\0416.CS_,0416.csv, 2.114,FE82CCD0D5BD8F6FDE7D48252C25F271,X:\I386\CATSRVUT.DL_,catsrvut.dll, 3.120,FE385CA3249BF6D30C031DEACE045AD3,X:\I386\DBMSRPCN.DL_,DBmsRPCn.dll, 3.452,FF32B826D2F3C5E41DCAF8B272AB0BF3,X:\I386\INETSRV.MI_,inetsrv.mib, 4.576,FF36362448658F15D2B6E3B593CA1B3F,X:\I386\BUSY_I.CU_,busy_i.cur, 4.513,FE97D798B2BC6CB4306B21E078AA6214,X:\I386\C_437.NL_,c_437.nls, 5.988,44029A87AD3484711FACB7945D242A95,X:\I386\0401.CS_,0401.csv, 5.123,FF39047446FC1C46FC0C1FA4071063CB,X:\I386\DG18D50.IC_,Dg18d50.icm, 6.976,FEC5273EB05873C93DA9BE16A94AEE94,X:\I386\AGT0401.DL_,Agt0401.dll, 7.892,FF04598C86B5DF9B78F122ABCB266790,X:\I386\AGT0419.HL_,Agt0419.hlp, 7.234,FE0399122F5DB5158E28AF73A1ED94A1,X:\I386\CDOSYS.DL_,cdosys.dll, 8.679,FFFBC075AA7E1756E35B5AF2E8BE7DEB,X:\I386\DISK.SY_,disk.sys, 9.123,FF9BDB807FC99B2B6156742AC2F9F2AB,X:\I386\COADMIN.DL_,coadmin.dll, 9.772,FFF5CBFC71FB5C80AAD9F834B3FB5062,X:\I386\IMESHARE.DL_,imeshare.dll, 10.32,FECC01645D83F150EBE2924887E30B91,X:\I386\DMUTIL.DL_,dmutil.dll, 12.65,FFF68CFBFA883D81731A6B344A25B782,X:\I386\CGA80852.FO_,cga80852.fon, 78.45,FFE31887684AED0F7B124378D942D3AC,X:\I386\CB32.EX_,cb32.exe, ===Result End=== It seems still some bugs in the code. Hope the feedback is useful. Best regards, nh_wzg -- View this message in context: http://www.nabble.com/Vim-Tips-wiki-celebrates-with-a-CSV-tip-tp18768619p19931031.html Sent from the Vim - General mailing list archive at Nabble.com. --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---