如何使用Windows命令行对CSV文件进行排序?

时间:2017-10-27 06:20:08

标签: csv sorting cmd

我有一个这样的文件:

9007,5001,800085,,100,40.00,,,,,20170923,,,8157,60400,,,,,,,5001,,,,,51815720718
9007,5001,9995,,100,40.00,,,,,20170930,,,8157,60400,,,,,,,5001,,,,,51815720718
9007,5001,35787654,,370,2.00,,,,,20170923,,,8157,60405,,,,,,,5001,,,,,51815720718
2001,5001,557,,370,4.25,,,,,20170930,,,8157,60405,,,,,,,5001,,,,,51815720718
9007,5001,657,,704,3.75,,4,,,20170930,,,8157,60400,,,,,,,5001,,,,,51815720718

我必须像这样对文件进行排序:

2001,5001,557,,370,4.25,,,,,20170930,,,8157,60405,,,,,,,5001,,,,,51815720718
9007,5001,657,,704,3.75,,4,,,20170930,,,8157,60400,,,,,,,5001,,,,,51815720718
9007,5001,800085,,100,40.00,,,,,20170923,,,8157,60400,,,,,,,5001,,,,,51815720718
9007,5001,9995,,100,40.00,,,,,20170930,,,8157,60400,,,,,,,5001,,,,,51815720718
9007,5001,35787654,,370,2.00,,,,,20170923,,,8157,60405,,,,,,,5001,,,,,51815720718

我曾使用sort FileName命令,但这没用,因为我得到的结果如下:

2001,5001,557,,370,4.25,,,,,20170930,,,8157,60405,,,,,,,5001,,,,,51815720718  
9007,5001,35787654,,370,2.00,,,,,20170923,,,8157,60405,,,,,,,5001,,,,,51815720718
9007,5001,657,,704,3.75,,4,,,20170930,,,8157,60400,,,,,,,5001,,,,,51815720718
9007,5001,800085,,100,40.00,,,,,20170923,,,8157,60400,,,,,,,5001,,,,,51815720718
9007,5001,9995,,100,40.00,,,,,20170930,,,8157,60400,,,,,,,5001,,,,,51815720718

有人可以帮我完成这项任务吗?

1 个答案:

答案 0 :(得分:-1)

Javascript用于操纵DOM元素。 CMD和Javascript是两个不同的维度。