perl - Ubuntu Splitting a file into three files with a third of the number of total lines in each -


i have simple ascii text file string in each line, like

aa1 aa2 ab1 ... 

with total of n lines. know can use split command split out fixed number of lines per file. how specify number of files want split , let split decide how many lines go each file. example if file had 100 lines, want able specify

split 3 foo.txt 

and write out 3 files xaa xab , xac each 33, 33 , 34 lines. possible? or write custom perl script this?

try doing :

split -n 3 file 

see

man split | less +/'^\s*-n' 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -