linux - extract lines of a file each day in bash -


i have file 20.000.000 lines , each day file added or removed lines , need crontab, need each day obtain 9 files of 50.000 lines.

for example:

bigfile file 20.000.000 lines. 

and need generate 9 files, first file line 1 50000, second file line 50001 100000, third file line 100001 150000 . . .

i can't split first time because file change days, , second problem have if first time obtain 9 files second day need continue last line use.

for example first day use 450.000 lines, second day need first line line 450001 500000, , third day need use 900001 first file.

the split not works because if use split first time, files change, files have not work second day

can me?

use split command (manpage).

for example:

$ split -l 50000 /path/to/bigfile 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -