2012-05-13 99 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個文件而沒有拆分線。正如在上面的評論中提到的,每個文件中都不重複標題。