LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   bash: split text file (https://www.linuxquestions.org/questions/programming-9/bash-split-text-file-355787/)

iluvatar 08-22-2005 08:38 AM

bash: split text file
 
Hello everybody,

I have to deal with very large text files (up to 1000000 rows). For the processing of these files, I'd like to split them into smaller pieces (say 10000 rows each). Is there a simple bash command (or bash script) to do such thing?

Thanks in advance,
.-=~ iluvatar ~=-.

bigearsbilly 08-22-2005 08:47 AM

guess what?


man split

google "man split"

jxi 08-22-2005 08:47 AM

man split

i think you want the option lines=10000

if you dont specify an output prefix it will put
first 10000 in xaa
second 10000 in xab
and so on...

iluvatar 08-22-2005 08:52 AM

gee I never knew this existed :S sorry for bothering you... and thanks for the awnsers!

bigearsbilly 08-22-2005 08:58 AM

no probs
;) that's what we log in for!


All times are GMT -5. The time now is 10:12 AM.