2012-05-13 100 views

回答

16

你看过split命令吗?有关更多信息,请参阅this男子页面。

这个page包含这个命令的一个使用示例。

旁白:

man -k命令是查找的Unix/Linux命令,如果你不太清楚具体的命令就是相当有用。使用man -k命令指定关键字,系统将提取相关命令。例如,

% man -k split 

将产生:

csplit (1)   - split a file into sections determined by context lines 
dirsplit (1)   - splits directory into multiple with equal size 
dpkg-split (1)  - Debian package archive split/join tool 
gpgsplit (1)   - Split an OpenPGP message into packets 
pnmsplit (1)   - split a multi-image portable anymap into multiple single-image files 
ppmtoyuvsplit (1) - convert a portable pixmap into 3 subsampled raw YUV files 
split (1)   - split a file into pieces 
splitdiff (1)  - separate out incremental patches 
splitfont (1)  - extract characters from an ISO-type font. 
URI::Split (3pm)  - Parse and compose URI strings 
wcstok (3)   - split wide-character string into tokens 
yuvsplittoppm (1) - convert a Y- and a U- and a V-file into a portable pixmap 
zipsplit (1)   - split a zipfile into smaller zipfiles 
+0

嗨,语法是正确的? ** split --lines = 5 1.csv ** – sprabhakaran

+4

@spk:语法正确,但这会将您的文件拆分为3,260,000个文件。您应该选择较高的值,高于8,150,000和低于16,300,000的任何金额将创建两个文件。 – Zeta

+0

像@spk提到的那样,选择正确的值会做你想要的。如果您在SO上提出的任何问题都为您的问题提供了正确的答案,请随时接受它们 - http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – Levon

1

分裂-d -n升/ N filename.csv tempfile.part。

将文件拆分为N个文件而没有拆分线。正如在上面的评论中提到的,每个文件中都不重复标题。