简体   繁体   English

Windows中等效的linux命令是什么?

[英]What is the equivalent linux command in Windows?

I am trying to merge all the files in Windows batch, then sort all the rows and filter only based on unique rows as header can be repeated many times. 我正在尝试合并Windows批处理中的所有文件,然后对所有行进行排序并仅基于唯一行进行过滤,因为标头可以重复多次。 I ever used linux and in linux this command is just this however I am not sure how can I do the same in windows bash, 我曾经使用过linux,在linux中,这个命令就是这样,但是我不确定如何在Windows bash中执行相同的操作,

sed 1d *.csv | sort -r| uniq  > merged-file.csv

To do this without the sorting part, you can simply run this from cmdline or in a batchfile. 为此,无需排序部分,您只需在cmdline或批处理文件中运行它即可。

copy *.csv merged-file.csv

Which will copy the content of each csv file into merged-file.csv 它将每个csv文件的内容复制到merged-file.csv

To do the sorting and uniq part, you would need a little more than a simple oneliner. 要进行排序和uniq部分,您需要的不仅仅是简单的oneliner。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM