Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have been trying to split a large file (some GB) into pieces, I need to chunk the file by linenumber (say, containings about 1M lines each).

How could I do? csplit does not work, goes out of memory. Below, an example of the content:

690451  World_War_II    Allies_of_World_War_II
690451  World_War_II    Axis_powers_of_World_War_II
share|improve this question

1 Answer 1

up vote 2 down vote accepted

Use the command line tool split with the -l (lines) option.

split -l 1000000
share|improve this answer
    
Ahhhh Thank you so much Daniel, it was so simple!!! Ich danke lhenen :D –  user305883 Feb 11 '12 at 9:25
    
You're welcome. Please remember to click the checkmark next to my answer to mark this question answered. –  Daniel Beck Feb 11 '12 at 9:27
    
thank you, did it. cannot vote yet :) –  user305883 Feb 11 '12 at 9:29
    
Thanks. Although I have to add to my answer, it ignores any context. But except for the title, you didn't mention that again, so I wasn't sure how to interpret that... –  Daniel Beck Feb 11 '12 at 9:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.