[OT] splitting files based on keyword
I have a large text file (humongous.txt) with the following structure
Is there any tool which will split the above file and give me three
smaller files 1-1-2005.txt, 1-2-2005.txt, 1-3-2005.txt etc., where
1-1-2005.txt will be
1-2-2005.txt will be
1-3-2005.txt will be
There is absolutely no correlation between the date and the number of
lines that it might contain. I just chose 3 dates, But in my file there
are about 1000 such sections and I do not want to do it manually. I am
wondering if there is any tool out there which does the above job.
I can do it with c or fortran but that does not appear to be elegant.
I looked at split, csplit. But they dont seem to do this. Googling did
not help much. Any other ideas?