Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell 在UNIX中按列将大文本文件拆分为多个小文件_Shell_Unix - Fatal编程技术网

Shell 在UNIX中按列将大文本文件拆分为多个小文件

Shell 在UNIX中按列将大文本文件拆分为多个小文件,shell,unix,Shell,Unix,我有一个大文件,我想把它分成多个小文件进行进一步的计算 大文件(file.txt)是一个由tab分隔的表 以下是我现在使用的: cut -f 1-3,4-100,898 file.txt > file_part1.txt cut -f 1-3,101-200,898 file.txt > file_part2.txt cut -f 1-3,201-300,898 file.txt > file_part3.txt ..... cut -f 1-3,8

我有一个大文件,我想把它分成多个小文件进行进一步的计算

大文件(file.txt)是一个由tab分隔的表

以下是我现在使用的:

   cut -f 1-3,4-100,898 file.txt > file_part1.txt
   cut -f 1-3,101-200,898 file.txt > file_part2.txt
   cut -f 1-3,201-300,898 file.txt > file_part3.txt
  .....
   cut -f 1-3,801-897,898 file.txt > file_part8.txt
我怎样才能把它写在循环中

谢谢

检查。您可以按行(多行)或字节(多字节)拆分文件。本例使用数字后缀将
file.txt
中的每5行放入前缀为
file
的单独文件中

split -l5 -d file.txt file

在大文件上尝试时会发生什么?