Link to home
Create AccountLog in
Avatar of Mike Satterfield
Mike Satterfield

asked on

VBscript to sort a CSV fille

I need a to automate the soriting of a CSV file (with headers.)

I need it to first sort by colum 2 and then reverse sort by colum J.
example.csv
Avatar of Bill Prew
Bill Prew

No easy sorting in VBscript, why not just open it in Excel and do the sort there, then save back out as a CSV?

If you really need a command line capability then here is a nice freeware utility I have used:

http://www.chmaas.handshake.de/delphi/freeware/cmsort/cmsort.htm

And of course Powershell can do this quite easily as well:

https://blogs.technet.microsoft.com/heyscriptingguy/2013/07/11/use-powershell-to-sort-csv-files-in-order/


~bp
Avatar of Mike Satterfield

ASKER

this will be part of an automated process.. thats why i'm looking for a commandline solution.

Can sort it with powershell, Thank you for the link.  but i am not able to reverse sort for the 10th coloum.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
That worked Great!.

Thank you!