How do I split a file into unequal line number segments? For example, I have a 100,000 line file that I need to split into 4 or 5 segments and the segments are not uniform, so split will not work in this case. The five segments might be: 27,000 44,512 13,542 2,344 & 12,602.
I can accomplish this by copying sections of files doing:
sed -n '1,27000p' filename
sed -n '27001,71513p' filename
sed -n '71514,85055p' filename
etc
I am wondering what the more elegant method(s) would be