I have a large files (800.000 records) and I want to split this into different files of 20.000 records each. This one I can do, but my next problem is that I want to know if it's possible to automatically generate the new files?
Example: file1 contains 800.000 records. First I get 20000 records out of it and move to another file, and then I remove the
sed -n '1,20000p;20001q' file1 > file1_1 sed -e 's/\r//g' file1_1 > file1
Is it possible to do something in a loop? or do I have to write this 40 times?
The number of records is variable, today it contains 800.000 records, but tomorrow it can contain 789.123 of 812.321 records. Do I have to give an 'end number' with the sed-command?
Thank you all for your answers!!