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
VB ScriptPowershell

Avatar of undefined
Last Comment
Mike Satterfield

8/22/2022 - Mon
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
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
Bill Prew

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Mike Satterfield

ASKER
That worked Great!.

Thank you!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck