如何分割在UNIX命令行大csv文件 [英] how to split a large csv file in unix command line
本文介绍了如何分割在UNIX命令行大csv文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是在零部件分裂一个非常大的CSV文件。当过我运行下面的命令。在不完全分裂,而返回我下面的错误。如何避免分割整个文件。
的awk -F,'{打印> $ 2}'test1.csv AWK:YY1使打开的文件太多
输入记录数31608,文件test1.csv
源代码行数1
解决方案
只是关闭
写作后的文件:
的awk -F,'{打印> $ 2;接近($ 2)}'test1.csv
I am just splitting a very large csv file in to parts. When ever i run the following command. the doesn't completely split rather returns me the following error. how can i avoid the split the whole file.
awk -F, '{print > $2}' test1.csv
awk: YY1 makes too many open files
input record number 31608, file test1.csv
source line number 1
解决方案
Just close
the files after writing:
awk -F, '{print > $2; close($2)}' test1.csv
这篇关于如何分割在UNIX命令行大csv文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文