Re: [OT] splitting files based on keyword

2005-06-22 Thread Stephen R Laniel
On Tue, Jun 21, 2005 at 09:57:07PM -0400, kamaraju kusumanchi wrote: > I have a large text file (humongous.txt) with the following structure One more Perl script to add to the mix, below. It's perhaps paranoid and verbose in its error reporting, but I hope it helps you to write your own scripts. Y

Re: [OT] splitting files based on keyword

2005-06-22 Thread Dave Carrigan
On Tue, Jun 21, 2005 at 09:57:07PM -0400, kamaraju kusumanchi wrote: > 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 perl -pe 'open STDOUT, ">$1.txt" if /^date (.*)/' the-big-file -- Dave Carrigan Seattl

Re: [OT] splitting files based on keyword

2005-06-22 Thread kamaraju kusumanchi
Kevin Mark wrote: On Tue, Jun 21, 2005 at 09:57:07PM -0400, kamaraju kusumanchi wrote: I have a large text file (humongous.txt) with the following structure date 1-1-2005 line1 line2 date 1-2-2005 line3 line4 date 1-3-2005 line5 line6 line7 line8 . Is there any tool which will split t

Re: [OT] splitting files based on keyword

2005-06-22 Thread Bill Marcum
On Tue, Jun 21, 2005 at 09:57:07PM -0400, kamaraju kusumanchi wrote: > I have a large text file (humongous.txt) with the following structure > > > date 1-1-2005 > line1 > line2 > date 1-2-2005 > line3 > line4 > date 1-3-2005 > line5 > line6 > line7 > line8 > . > > Is there any tool which wil

Re: [OT] splitting files based on keyword

2005-06-21 Thread Chris F.A. Johnson
On 2005-06-22, kamaraju kusumanchi wrote: > I have a large text file (humongous.txt) with the following structure > > > date 1-1-2005 > line1 > line2 > date 1-2-2005 > line3 > line4 > date 1-3-2005 > line5 > line6 > line7 > line8 > . > > Is there any tool which will split the above file and giv

Re: [OT] splitting files based on keyword

2005-06-21 Thread Kevin Mark
On Tue, Jun 21, 2005 at 09:57:07PM -0400, kamaraju kusumanchi wrote: > I have a large text file (humongous.txt) with the following structure > > > date 1-1-2005 > line1 > line2 > date 1-2-2005 > line3 > line4 > date 1-3-2005 > line5 > line6 > line7 > line8 > . > > Is there any tool which wil

Re: [OT] splitting files based on keyword

2005-06-21 Thread Andy Smith
On Tue, Jun 21, 2005 at 09:57:07PM -0400, kamaraju kusumanchi wrote: > 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? Time to learn a scripting language? :) This i

Re: [OT] splitting files based on keyword

2005-06-21 Thread Clinton V. Weiss
kamaraju kusumanchi wrote: I have a large text file (humongous.txt) with the following structure date 1-1-2005 line1 line2 date 1-2-2005 line3 line4 date 1-3-2005 line5 line6 line7 line8 . Is there any tool which will split the above file and give me three smaller files 1-1-2005.txt, 1-2